completes the systematic migration started by #1351 (lab_06 proof). 30 labs refactored across vol1 and vol2, each verified individually.
what changed
for each lab, a script applied the Pattern C transformation:
remove cell-level mo.stop(<prediction>.value is None, ...) calls from @app.cell widget cells
simplify cell signatures when the gate dep was only used in the removed mo.stop
trust the internal build_part_X() gates that already exist in every lab (they already show the 'unlock' callout inside each tab until that part's prediction is answered)
labs updated (30, one commit each)
vol1
vol2
lab_01_ml_intro ✓
lab_01_introduction ✓
lab_02_ml_systems ✓
lab_02_compute_infra ✓
lab_03_ml_workflow ✓
lab_03_communication ✓
lab_04_data_engr ✓
lab_04_data_storage ✓
lab_05_nn_compute ✓
lab_07_fleet_orch ✓
lab_06_nn_arch ✓
lab_08_inference ✓
lab_07_ml_frameworks ✓
lab_09_perf_engineering ✓
lab_08_model_train ✓
lab_10_edge_intelligence ✓
lab_09_data_selection ✓
lab_11_ops_scale ✓
lab_10_model_compress ✓
lab_12_security_privacy ✓
lab_11_hw_accel ✓
lab_13_robust_ai ✓
lab_12_perf_bench ✓
lab_14_sustainable_ai ✓
lab_13_model_serving ✓
lab_15_responsible_ai ✓
lab_14_ml_ops ✓
lab_16_fleet_synthesis ✓
lab_15_responsible_engr ✓
lab_16_ml_conclusion ✓
not touched:
vol2/lab_05_dist_train — already Pattern C (no changes needed)
vol1/lab_00_introduction — its check1/check2/check3 pattern is structurally different, mechanical transformation broke engine tests, kept in the grandfather list in #1347 for manual refactor
verification
each lab passed:
marimo check — clean
pytest labs/tests/test_engine.py -k <lab_name> — cells execute, produce outputs
if any lab failed either check, the branch was reverted (that's what happened to lab_00, reverted cleanly)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1352
Author: @profvjreddi
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/16/2026
Merged by: @profvjreddi
Base:
dev← Head:refactor/all-labs-pattern-c📝 Commits (10+)
36e70b4refactor(labs/lab_02): Pattern C migration033d1e7refactor(labs/lab_03_ml_workflow): Pattern C migrationb8640e4refactor(labs/lab_04_data_engr): Pattern C migrationddce2e7refactor(labs/lab_05_nn_compute): Pattern C migration16d80b9refactor(labs/lab_06_nn_arch): Pattern C migration733a5eerefactor(labs/lab_07_ml_frameworks): Pattern C migration1239677refactor(labs/lab_08_model_train): Pattern C migration2d1e6c5refactor(labs/lab_09_data_selection): Pattern C migration0cef280refactor(labs/lab_10_model_compress): Pattern C migration905f69brefactor(labs/lab_11_hw_accel): Pattern C migration📊 Changes
31 files changed (+110 additions, -370 deletions)
View changed files
📝
labs/tests/test_static.py(+3 -13)📝
labs/vol1/lab_01_ml_intro.py(+4 -12)📝
labs/vol1/lab_02_ml_systems.py(+3 -11)📝
labs/vol1/lab_03_ml_workflow.py(+3 -11)📝
labs/vol1/lab_04_data_engr.py(+3 -11)📝
labs/vol1/lab_05_nn_compute.py(+3 -11)📝
labs/vol1/lab_06_nn_arch.py(+3 -11)📝
labs/vol1/lab_07_ml_frameworks.py(+3 -11)📝
labs/vol1/lab_08_model_train.py(+3 -11)📝
labs/vol1/lab_09_data_selection.py(+3 -11)📝
labs/vol1/lab_10_model_compress.py(+4 -14)📝
labs/vol1/lab_11_hw_accel.py(+4 -14)📝
labs/vol1/lab_12_perf_bench.py(+3 -11)📝
labs/vol1/lab_13_model_serving.py(+3 -11)📝
labs/vol1/lab_14_ml_ops.py(+3 -11)📝
labs/vol1/lab_15_responsible_engr.py(+3 -11)📝
labs/vol1/lab_16_ml_conclusion.py(+4 -14)📝
labs/vol2/lab_01_introduction.py(+4 -12)📝
labs/vol2/lab_02_compute_infra.py(+4 -14)📝
labs/vol2/lab_03_communication.py(+4 -14)...and 11 more files
📄 Description
completes the systematic migration started by #1351 (lab_06 proof). 30 labs refactored across vol1 and vol2, each verified individually.
what changed
for each lab, a script applied the Pattern C transformation:
mo.stop(<prediction>.value is None, ...)calls from @app.cell widget cellsbuild_part_X()gates that already exist in every lab (they already show the 'unlock' callout inside each tab until that part's prediction is answered)labs updated (30, one commit each)
not touched:
vol2/lab_05_dist_train— already Pattern C (no changes needed)vol2/lab_06_fault_tolerance— merged via [GH-ISSUE #304] Suggestion: Cite the following papers (#1351)vol1/lab_00_introduction— its check1/check2/check3 pattern is structurally different, mechanical transformation broke engine tests, kept in the grandfather list in #1347 for manual refactorverification
each lab passed:
marimo check— cleanpytest labs/tests/test_engine.py -k <lab_name>— cells execute, produce outputsfull repo run after all commits:
pytest labs/tests/test_static.py— 688 passed, 5 skipped (grandfather list + pre-existing), 1 xfailed (unrelated)pytest labs/tests/test_engine.py— 70 passedcommits
30 per-lab commits + 1 grandfather-list update. each per-lab commit is independently reviewable (small diff, typically 3-14 lines).
related
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.