mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-07 02:03:55 -05:00
[PR #1349] [CLOSED] refactor(labs): remove widget-in-gated-cell pattern from 30 labs #5145
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1349
Author: @profvjreddi
Created: 4/16/2026
Status: ❌ Closed
Base:
dev← Head:refactor/lab-widget-cells📝 Commits (1)
78bc87arefactor(labs): remove widget-in-gated-cell pattern from 30 labs📊 Changes
32 files changed (+113 additions, -333 deletions)
View changed files
📝
labs/vol1/lab_00_introduction.py(+2 -4)📝
labs/vol1/lab_01_ml_intro.py(+4 -10)📝
labs/vol1/lab_02_ml_systems.py(+3 -9)📝
labs/vol1/lab_03_ml_workflow.py(+3 -9)📝
labs/vol1/lab_04_data_engr.py(+3 -9)📝
labs/vol1/lab_05_nn_compute.py(+3 -9)📝
labs/vol1/lab_06_nn_arch.py(+3 -9)📝
labs/vol1/lab_07_ml_frameworks.py(+3 -9)📝
labs/vol1/lab_08_model_train.py(+3 -9)📝
labs/vol1/lab_09_data_selection.py(+3 -9)📝
labs/vol1/lab_10_model_compress.py(+4 -12)📝
labs/vol1/lab_11_hw_accel.py(+4 -12)📝
labs/vol1/lab_12_perf_bench.py(+3 -9)📝
labs/vol1/lab_13_model_serving.py(+3 -9)📝
labs/vol1/lab_14_ml_ops.py(+3 -9)📝
labs/vol1/lab_15_responsible_engr.py(+3 -9)📝
labs/vol1/lab_16_ml_conclusion.py(+4 -12)📝
labs/vol2/lab_01_introduction.py(+4 -12)📝
labs/vol2/lab_02_compute_infra.py(+4 -12)📝
labs/vol2/lab_03_communication.py(+4 -12)...and 12 more files
📄 Description
applies the canonical pattern (already established in
vol2/lab_05_dist_train) across 30 of 33 labs. addresses the bulk of #1347.what and why
widget-defining cells should not contain
mo.stop()gates. the tabs cell already handles per-part display gating viaif prediction.value is None: return lock_msginside eachbuild_part_X()function, so the outer gate in widget cells was redundant and caused a dependency cascade bug where later cells could not run until earlier ones unblocked.surfaced originally in lab_01 (fixed via #1339 manually) and tracked in #1347 as a systematic cleanup.
transformation
for every widget cell matching this pattern:
remove the gate and the prediction dep from the signature:
applied only where the prediction dep was used nowhere else in the cell. cells that read the prediction's value for computation were left untouched and stay tracked in #1347.
labs updated (30)
vol1/lab_00(partial: check1 gate removed)vol1/lab_02throughvol1/lab_16(15 labs, all widget-gate cells cleaned)vol2/lab_01throughvol2/lab_04,vol2/lab_06throughvol2/lab_16(14 labs)labs still xfail on widget-gated check (3)
vol1/lab_00: check2, check3, context_selector gates read their deps for feedback logicvol1/lab_01: some instrument cells mix gate + instrument usevol2/lab_11: partE synthesis cell has complex dep usagethese 3 need judgment-based per-cell refactor. #1347 stays open for them.
verification
marimo check labs/vol{1,2}/*.py— clean across all 33 labspytest labs/tests/test_static.py— 656 passed, 4 skipped, 3 xfailed, 30 xpassed (before: 33 xfailed, 1 xpassed)net diff
32 files changed, 113 insertions(+), 333 deletions(-)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.