Skip to content

Commit 6cb15d5

Browse files
authored
Remove lazy and GPU variants (#3109)
1 parent 5eae080 commit 6cb15d5

File tree

7 files changed

+6
-75
lines changed

7 files changed

+6
-75
lines changed

src/commons/__tests__/Markdown.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ test('Markdown page renders correct Source information', () => {
2222
const source1Default = <Markdown {...mockProps(Chapter.SOURCE_1, Variant.DEFAULT)} />;
2323
expect(source1Default.props.content).toContain('Source \xa71');
2424

25-
const source1Lazy = <Markdown {...mockProps(Chapter.SOURCE_1, Variant.LAZY)} />;
26-
expect(source1Lazy.props.content).toContain('Source \xa71 Lazy');
27-
2825
const source1Wasm = <Markdown {...mockProps(Chapter.SOURCE_1, Variant.WASM)} />;
2926
expect(source1Wasm.props.content).toContain('Source \xa71 WebAssembly');
3027

3128
const source2Default = <Markdown {...mockProps(Chapter.SOURCE_2, Variant.DEFAULT)} />;
3229
expect(source2Default.props.content).toContain('Source \xa72');
3330

34-
const source2Lazy = <Markdown {...mockProps(Chapter.SOURCE_2, Variant.LAZY)} />;
35-
expect(source2Lazy.props.content).toContain('Source \xa72 Lazy');
36-
3731
const source3Default = <Markdown {...mockProps(Chapter.SOURCE_3, Variant.DEFAULT)} />;
3832
expect(source3Default.props.content).toContain('Source \xa73');
3933

@@ -42,7 +36,4 @@ test('Markdown page renders correct Source information', () => {
4236

4337
const source4Default = <Markdown {...mockProps(Chapter.SOURCE_4, Variant.DEFAULT)} />;
4438
expect(source4Default.props.content).toContain('Source \xa74');
45-
46-
const source4GPU = <Markdown {...mockProps(Chapter.SOURCE_4, Variant.GPU)} />;
47-
expect(source4GPU.props.content).toContain('Source \xa74 GPU');
4839
});

src/commons/application/ApplicationTypes.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ const variantDisplay: Map<Variant, string> = new Map([
161161
[Variant.TYPED, 'Typed'],
162162
[Variant.WASM, 'WebAssembly'],
163163
[Variant.CONCURRENT, 'Concurrent'],
164-
[Variant.LAZY, 'Lazy'],
165-
[Variant.GPU, 'GPU'],
166164
[Variant.NATIVE, 'Native'],
167165
[Variant.EXPLICIT_CONTROL, 'Explicit-Control']
168166
]);
@@ -260,12 +258,10 @@ const sourceSubLanguages: Array<Pick<SALanguage, 'chapter' | 'variant'>> = [
260258
{ chapter: Chapter.SOURCE_1, variant: Variant.DEFAULT },
261259
{ chapter: Chapter.SOURCE_1, variant: Variant.TYPED },
262260
{ chapter: Chapter.SOURCE_1, variant: Variant.WASM },
263-
{ chapter: Chapter.SOURCE_1, variant: Variant.LAZY },
264261
{ chapter: Chapter.SOURCE_1, variant: Variant.NATIVE },
265262

266263
{ chapter: Chapter.SOURCE_2, variant: Variant.DEFAULT },
267264
{ chapter: Chapter.SOURCE_2, variant: Variant.TYPED },
268-
{ chapter: Chapter.SOURCE_2, variant: Variant.LAZY },
269265
{ chapter: Chapter.SOURCE_2, variant: Variant.NATIVE },
270266

271267
{ chapter: Chapter.SOURCE_3, variant: Variant.DEFAULT },
@@ -275,7 +271,6 @@ const sourceSubLanguages: Array<Pick<SALanguage, 'chapter' | 'variant'>> = [
275271

276272
{ chapter: Chapter.SOURCE_4, variant: Variant.DEFAULT },
277273
{ chapter: Chapter.SOURCE_4, variant: Variant.TYPED },
278-
{ chapter: Chapter.SOURCE_4, variant: Variant.GPU },
279274
{ chapter: Chapter.SOURCE_4, variant: Variant.NATIVE },
280275
{ chapter: Chapter.SOURCE_4, variant: Variant.EXPLICIT_CONTROL }
281276
];

src/commons/application/__tests__/ApplicationTypes.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe('available Source language configurations', () => {
2727
{ chapter: Chapter.SOURCE_1, variant: Variant.DEFAULT, supports: { substVisualizer: true } },
2828
{ chapter: Chapter.SOURCE_1, variant: Variant.TYPED, supports: { substVisualizer: true } },
2929
{ chapter: Chapter.SOURCE_1, variant: Variant.WASM },
30-
{ chapter: Chapter.SOURCE_1, variant: Variant.LAZY },
3130
{ chapter: Chapter.SOURCE_1, variant: Variant.NATIVE, supports: { substVisualizer: true } },
3231
// Source 2
3332
{
@@ -40,7 +39,6 @@ describe('available Source language configurations', () => {
4039
variant: Variant.TYPED,
4140
supports: { dataVisualizer: true, substVisualizer: true }
4241
},
43-
{ chapter: Chapter.SOURCE_2, variant: Variant.LAZY, supports: { dataVisualizer: true } },
4442
{
4543
chapter: Chapter.SOURCE_2,
4644
variant: Variant.NATIVE,
@@ -78,11 +76,6 @@ describe('available Source language configurations', () => {
7876
variant: Variant.TYPED,
7977
supports: { dataVisualizer: true, cseMachine: true }
8078
},
81-
{
82-
chapter: Chapter.SOURCE_4,
83-
variant: Variant.GPU,
84-
supports: { dataVisualizer: true, cseMachine: true }
85-
},
8679
{
8780
chapter: Chapter.SOURCE_4,
8881
variant: Variant.NATIVE,

src/commons/application/__tests__/__snapshots__/ApplicationTypes.ts.snap

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,6 @@ Array [
110110
},
111111
"variant": "wasm",
112112
},
113-
Object {
114-
"chapter": 1,
115-
"displayName": "Source §1 Lazy",
116-
"mainLanguage": "JavaScript",
117-
"supports": Object {
118-
"cseMachine": false,
119-
"dataVisualizer": false,
120-
"multiFile": false,
121-
"repl": true,
122-
"substVisualizer": false,
123-
},
124-
"variant": "lazy",
125-
},
126113
Object {
127114
"chapter": 1,
128115
"displayName": "Source §1 Native",
@@ -162,19 +149,6 @@ Array [
162149
},
163150
"variant": "typed",
164151
},
165-
Object {
166-
"chapter": 2,
167-
"displayName": "Source §2 Lazy",
168-
"mainLanguage": "JavaScript",
169-
"supports": Object {
170-
"cseMachine": false,
171-
"dataVisualizer": true,
172-
"multiFile": true,
173-
"repl": true,
174-
"substVisualizer": false,
175-
},
176-
"variant": "lazy",
177-
},
178152
Object {
179153
"chapter": 2,
180154
"displayName": "Source §2 Native",
@@ -266,19 +240,6 @@ Array [
266240
},
267241
"variant": "typed",
268242
},
269-
Object {
270-
"chapter": 4,
271-
"displayName": "Source §4 GPU",
272-
"mainLanguage": "JavaScript",
273-
"supports": Object {
274-
"cseMachine": true,
275-
"dataVisualizer": true,
276-
"multiFile": true,
277-
"repl": true,
278-
"substVisualizer": false,
279-
},
280-
"variant": "gpu",
281-
},
282243
Object {
283244
"chapter": 4,
284245
"displayName": "Source §4 Native",

src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,7 @@ export function* evalCodeSaga(
130130
const entrypointCode = files[entrypointFilePath];
131131

132132
function call_variant(variant: Variant) {
133-
if (variant === Variant.LAZY) {
134-
return call(runFilesInContext, files, entrypointFilePath, context, {
135-
scheduler: 'preemptive',
136-
originalMaxExecTime: execTime,
137-
stepLimit: stepLimit,
138-
useSubst: substActiveAndCorrectChapter,
139-
envSteps: currentStep
140-
});
141-
} else if (variant === Variant.WASM) {
133+
if (variant === Variant.WASM) {
142134
// Note: WASM does not support multiple file programs.
143135
return call(
144136
wasm_compile_and_run,
@@ -256,7 +248,6 @@ export function* evalCodeSaga(
256248
});
257249
}
258250

259-
const isLazy: boolean = context.variant === Variant.LAZY;
260251
const isWasm: boolean = context.variant === Variant.WASM;
261252
const isC: boolean = context.chapter === Chapter.FULL_C;
262253
const isJava: boolean = context.chapter === Chapter.FULL_JAVA;
@@ -284,7 +275,7 @@ export function* evalCodeSaga(
284275
result:
285276
actionType === InterpreterActions.debuggerResume.type
286277
? call(resume, lastDebuggerResult)
287-
: isLazy || isWasm
278+
: isWasm
288279
? call_variant(context.variant)
289280
: isC
290281
? call(cCompileAndRun, entrypointCode, context)

src/commons/sagas/__tests__/BackendSaga.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ describe('Test CHANGE_SUBLANGUAGE action', () => {
832832
test('when chapter is changed', () => {
833833
const sublang: SALanguage = {
834834
chapter: Chapter.SOURCE_4,
835-
variant: Variant.GPU,
836-
displayName: 'Source \xa74 GPU',
835+
variant: Variant.CONCURRENT,
836+
displayName: 'Source \xa74 Concurrent',
837837
mainLanguage: SupportedLanguage.JAVASCRIPT,
838838
supports: {}
839839
};
@@ -854,7 +854,7 @@ describe('Test CHANGE_SUBLANGUAGE action', () => {
854854
[
855855
call(putCourseConfig, mockTokens, {
856856
sourceChapter: Chapter.SOURCE_4,
857-
sourceVariant: Variant.GPU
857+
sourceVariant: Variant.CONCURRENT
858858
}),
859859
{ ok: true }
860860
]

src/commons/sagas/__tests__/PersistenceSaga.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const FILE_ID = '123';
2020
const FILE_NAME = 'file';
2121
const FILE_DATA = '// Hello world';
2222
const SOURCE_CHAPTER = Chapter.SOURCE_3;
23-
const SOURCE_VARIANT = Variant.LAZY;
23+
const SOURCE_VARIANT = Variant.DEFAULT;
2424
const SOURCE_LIBRARY = ExternalLibraryName.SOUNDS;
2525

2626
beforeAll(() => {

0 commit comments

Comments
 (0)