fix(mlsysim): surface load errors via last_load_error on DesignLedger - #2007
fix(mlsysim): surface load errors via last_load_error on DesignLedger#2007ShivtejG236 wants to merge 4 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
…n, unify fixture style
|
lgtm. tagging professor for a review from his end. |
|
Thanks @ShivtejG236, and welcome. Integrated into dev. Your six new tests pass here alongside the existing five. Good first PR to pick, and thanks for the patience on the review. I applied your commit onto a review branch off current dev rather than merging the PR head, so GitHub will show this as closed instead of merged. Authorship and credit are intact. @all-contributors please add @ShivtejG236 for bug, code, test in mlsysim |
|
I've added @ShivtejG236 as a contributor to mlsysim! 🎉 Recognized for: bug, code, test The contributor list has been updated in:
We love recognizing our contributors! ❤️ |
Thank you, Professor! Was an amazing experience working on this. As my first real OSS contribution, I learnt a lot, especially through the review process |
|
I've added @ShivtejG236 as a contributor to mlsysim! 🎉 Recognized for: bug, code, test The contributor list has been updated in:
We love recognizing our contributors! ❤️ |
1 similar comment
|
I've added @ShivtejG236 as a contributor to mlsysim! 🎉 Recognized for: bug, code, test The contributor list has been updated in:
We love recognizing our contributors! ❤️ |
Land five verified contributor fixes from the open-PR triage: #2089 utf-8 encoding on all tito file I/O (Windows cp1252 crashes) #2093 Conv2d FLOP counting in the profiler (TypeError on real layers) #2022 --skip-profile no longer prompts for community registration #2071 setup survives a corrupted profile.json; atomic profile write #2007 DesignLedger.last_load_error surfaces swallowed load failures Each was verified against the code rather than the PR description, and authorship is preserved per commit. Unit suite matches the pre-merge dev baseline exactly (641 passed / 3 pre-existing failures, 672 total).
Summary
Fixes #1994.
DesignLedger.load()/load_async()previously reset silentlyto a blank
LedgerState()on any read failure (missing file, corrupt JSON,IndexedDB error), with no way for calling code to distinguish "first run,
nothing saved yet" from "a save exists but couldn't be read" — a silent
data-loss bug on the read path. Adds
last_load_error, mirroring thelast_save_errorpattern #1988 established on the write path.Area
(No box above quite fits
mlsysim/Co-Labs specifically — checkingInfrastructure as the closest match. Actual area:
mlsysim/mlsysim/labs/and
labs/tests/.)Changes
mlsysim/mlsysim/labs/state.py: add_last_load_error+ read-onlylast_load_errorproperty; set it inload()andload_async()'sexcept blocks instead of discarding the exception.
mlsysim/tests/test_state.py: add native-path regression tests(missing file is not an error, corrupt file sets
last_load_errorandfalls back to blank state, error clears on next successful load).
labs/tests/test_wasm_persistence.py: add two real-browser(Playwright + Chromium + Pyodide) regression tests for
load_async()—corrupt IndexedDB record, and
indexedDB.open()throwing synchronously —reusing the
served_dirfixture fix(labs): stop silently dropping WASM DesignLedger saves (#1985) #1988 introduced.Rebased cleanly onto
devafter #1988 merged; no leftover conflicts.Testing
quarto render)pytest tests/)tito module test NNfor affected module(s)Ran explicitly: