Skip to content

Remove lazy and GPU variants #3109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/commons/__tests__/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ test('Markdown page renders correct Source information', () => {
const source1Default = <Markdown {...mockProps(Chapter.SOURCE_1, Variant.DEFAULT)} />;
expect(source1Default.props.content).toContain('Source \xa71');

const source1Lazy = <Markdown {...mockProps(Chapter.SOURCE_1, Variant.LAZY)} />;
expect(source1Lazy.props.content).toContain('Source \xa71 Lazy');

const source1Wasm = <Markdown {...mockProps(Chapter.SOURCE_1, Variant.WASM)} />;
expect(source1Wasm.props.content).toContain('Source \xa71 WebAssembly');

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

const source2Lazy = <Markdown {...mockProps(Chapter.SOURCE_2, Variant.LAZY)} />;
expect(source2Lazy.props.content).toContain('Source \xa72 Lazy');

const source3Default = <Markdown {...mockProps(Chapter.SOURCE_3, Variant.DEFAULT)} />;
expect(source3Default.props.content).toContain('Source \xa73');

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

const source4Default = <Markdown {...mockProps(Chapter.SOURCE_4, Variant.DEFAULT)} />;
expect(source4Default.props.content).toContain('Source \xa74');

const source4GPU = <Markdown {...mockProps(Chapter.SOURCE_4, Variant.GPU)} />;
expect(source4GPU.props.content).toContain('Source \xa74 GPU');
});
5 changes: 0 additions & 5 deletions src/commons/application/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ const variantDisplay: Map<Variant, string> = new Map([
[Variant.TYPED, 'Typed'],
[Variant.WASM, 'WebAssembly'],
[Variant.CONCURRENT, 'Concurrent'],
[Variant.LAZY, 'Lazy'],
[Variant.GPU, 'GPU'],
[Variant.NATIVE, 'Native'],
[Variant.EXPLICIT_CONTROL, 'Explicit-Control']
]);
Expand Down Expand Up @@ -260,12 +258,10 @@ const sourceSubLanguages: Array<Pick<SALanguage, 'chapter' | 'variant'>> = [
{ chapter: Chapter.SOURCE_1, variant: Variant.DEFAULT },
{ chapter: Chapter.SOURCE_1, variant: Variant.TYPED },
{ chapter: Chapter.SOURCE_1, variant: Variant.WASM },
{ chapter: Chapter.SOURCE_1, variant: Variant.LAZY },
{ chapter: Chapter.SOURCE_1, variant: Variant.NATIVE },

{ chapter: Chapter.SOURCE_2, variant: Variant.DEFAULT },
{ chapter: Chapter.SOURCE_2, variant: Variant.TYPED },
{ chapter: Chapter.SOURCE_2, variant: Variant.LAZY },
{ chapter: Chapter.SOURCE_2, variant: Variant.NATIVE },

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

{ chapter: Chapter.SOURCE_4, variant: Variant.DEFAULT },
{ chapter: Chapter.SOURCE_4, variant: Variant.TYPED },
{ chapter: Chapter.SOURCE_4, variant: Variant.GPU },
{ chapter: Chapter.SOURCE_4, variant: Variant.NATIVE },
{ chapter: Chapter.SOURCE_4, variant: Variant.EXPLICIT_CONTROL }
];
Expand Down
7 changes: 0 additions & 7 deletions src/commons/application/__tests__/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe('available Source language configurations', () => {
{ chapter: Chapter.SOURCE_1, variant: Variant.DEFAULT, supports: { substVisualizer: true } },
{ chapter: Chapter.SOURCE_1, variant: Variant.TYPED, supports: { substVisualizer: true } },
{ chapter: Chapter.SOURCE_1, variant: Variant.WASM },
{ chapter: Chapter.SOURCE_1, variant: Variant.LAZY },
{ chapter: Chapter.SOURCE_1, variant: Variant.NATIVE, supports: { substVisualizer: true } },
// Source 2
{
Expand All @@ -40,7 +39,6 @@ describe('available Source language configurations', () => {
variant: Variant.TYPED,
supports: { dataVisualizer: true, substVisualizer: true }
},
{ chapter: Chapter.SOURCE_2, variant: Variant.LAZY, supports: { dataVisualizer: true } },
{
chapter: Chapter.SOURCE_2,
variant: Variant.NATIVE,
Expand Down Expand Up @@ -78,11 +76,6 @@ describe('available Source language configurations', () => {
variant: Variant.TYPED,
supports: { dataVisualizer: true, cseMachine: true }
},
{
chapter: Chapter.SOURCE_4,
variant: Variant.GPU,
supports: { dataVisualizer: true, cseMachine: true }
},
{
chapter: Chapter.SOURCE_4,
variant: Variant.NATIVE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,6 @@ Array [
},
"variant": "wasm",
},
Object {
"chapter": 1,
"displayName": "Source §1 Lazy",
"mainLanguage": "JavaScript",
"supports": Object {
"cseMachine": false,
"dataVisualizer": false,
"multiFile": false,
"repl": true,
"substVisualizer": false,
},
"variant": "lazy",
},
Object {
"chapter": 1,
"displayName": "Source §1 Native",
Expand Down Expand Up @@ -162,19 +149,6 @@ Array [
},
"variant": "typed",
},
Object {
"chapter": 2,
"displayName": "Source §2 Lazy",
"mainLanguage": "JavaScript",
"supports": Object {
"cseMachine": false,
"dataVisualizer": true,
"multiFile": true,
"repl": true,
"substVisualizer": false,
},
"variant": "lazy",
},
Object {
"chapter": 2,
"displayName": "Source §2 Native",
Expand Down Expand Up @@ -266,19 +240,6 @@ Array [
},
"variant": "typed",
},
Object {
"chapter": 4,
"displayName": "Source §4 GPU",
"mainLanguage": "JavaScript",
"supports": Object {
"cseMachine": true,
"dataVisualizer": true,
"multiFile": true,
"repl": true,
"substVisualizer": false,
},
"variant": "gpu",
},
Object {
"chapter": 4,
"displayName": "Source §4 Native",
Expand Down
13 changes: 2 additions & 11 deletions src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,7 @@ export function* evalCodeSaga(
const entrypointCode = files[entrypointFilePath];

function call_variant(variant: Variant) {
if (variant === Variant.LAZY) {
return call(runFilesInContext, files, entrypointFilePath, context, {
scheduler: 'preemptive',
originalMaxExecTime: execTime,
stepLimit: stepLimit,
useSubst: substActiveAndCorrectChapter,
envSteps: currentStep
});
} else if (variant === Variant.WASM) {
if (variant === Variant.WASM) {
// Note: WASM does not support multiple file programs.
return call(
wasm_compile_and_run,
Expand Down Expand Up @@ -256,7 +248,6 @@ export function* evalCodeSaga(
});
}

const isLazy: boolean = context.variant === Variant.LAZY;
const isWasm: boolean = context.variant === Variant.WASM;
const isC: boolean = context.chapter === Chapter.FULL_C;
const isJava: boolean = context.chapter === Chapter.FULL_JAVA;
Expand Down Expand Up @@ -284,7 +275,7 @@ export function* evalCodeSaga(
result:
actionType === InterpreterActions.debuggerResume.type
? call(resume, lastDebuggerResult)
: isLazy || isWasm
: isWasm
? call_variant(context.variant)
: isC
? call(cCompileAndRun, entrypointCode, context)
Expand Down
6 changes: 3 additions & 3 deletions src/commons/sagas/__tests__/BackendSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ describe('Test CHANGE_SUBLANGUAGE action', () => {
test('when chapter is changed', () => {
const sublang: SALanguage = {
chapter: Chapter.SOURCE_4,
variant: Variant.GPU,
displayName: 'Source \xa74 GPU',
variant: Variant.CONCURRENT,
displayName: 'Source \xa74 Concurrent',
mainLanguage: SupportedLanguage.JAVASCRIPT,
supports: {}
};
Expand All @@ -854,7 +854,7 @@ describe('Test CHANGE_SUBLANGUAGE action', () => {
[
call(putCourseConfig, mockTokens, {
sourceChapter: Chapter.SOURCE_4,
sourceVariant: Variant.GPU
sourceVariant: Variant.CONCURRENT
}),
{ ok: true }
]
Expand Down
2 changes: 1 addition & 1 deletion src/commons/sagas/__tests__/PersistenceSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FILE_ID = '123';
const FILE_NAME = 'file';
const FILE_DATA = '// Hello world';
const SOURCE_CHAPTER = Chapter.SOURCE_3;
const SOURCE_VARIANT = Variant.LAZY;
const SOURCE_VARIANT = Variant.DEFAULT;
const SOURCE_LIBRARY = ExternalLibraryName.SOUNDS;

beforeAll(() => {
Expand Down