Repository navigation
Why is it this value? Explain any value in an example's timeline - #21
Merged
Merged
Conversation
Clicking a value in "What actually happened" shows the line of the design that wrote it, why that line ran (each if/case around it and which way it went, with the values decided on) and the values it used, each clickable in turn, through block ports back to the example step that set an input. The explanation followed goes with requests to the AI. The simulator records, for every value change, the assignment that made it: WaveSignal::by and SimResult::origins (line, text, reads, decisions), exposed to the browser through wafer-sim-wasm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In an example's What actually happened timeline, any value can now be clicked. A Why? panel explains it:
Every value mentioned can be clicked in turn, building a chain back to the cause: through block ports, to the example step that set an input ("set by step 1 of the example"). When the person then asks the AI to fix the design (or the assistant to fix the example), the chain goes with the request. Runs in the browser; no AI, no cost.
How
wafer-sim): elaboration gives each assignment (and port connection, continuous assign, declaration initialiser) anOrigin: file, line, scope, text as written, the signals it reads, and the enclosingif/casedecisions with the way each went.Op::From(n)marks it; the simulator carries it with each write and records it per change inWaveSignal::by, alongsideSimResult::origins. A starting value an assignment confirms without changing is credited to it.by(i)andorigins()(JSON).lib/why.tsfollows a value at a time to its origin (port hops followed; nonblocking assignments read just before the clock edge);Replayexposes the simulation, check times andcycleAt; the timeline rows are clickable and theWhyPanelshows the chain.Checked
led→cnt→cnt→en(step 1); the UART receiver tracedvalid→state3 →state2 →rxthrough its case arms.cargo fmt --check, clippy-D warnings,cargo test --workspace, web typecheck and build.🤖 Generated with Claude Code