Repository navigation
Why wasn't it the expected value? Explain a failing check - #22
Merged
Merged
Conversation
A failing example's account ends with "Why wasn't it N?": every line of the design that could have written the expected value, and for each the decision that kept it from running (with the values decided on), or that it ran and computed something else. Its values continue into the "Why?" chain, and the answer goes with requests to the AI. The simulator records every if/case decision with the branch taken (SimResult::decisions, capped at MAX_DECISIONS) and which signal each assignment writes (Origin::writes); conditions name their branch point. 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
A failing example's account in What actually happened now ends with a Why wasn't it N? link. It lists every line of the design that could have given the signal the expected value, and what happened to it the last time it could have run:
led <= ~led. Didn't run for cycle 3 (!rst_nwas false,!enwas false) becausecnt == N - 1was false (cnt = 2)."Lines that only write other constants are left out and counted. If no line can write the expected value, it says so. Values in the answer can be clicked to continue in the existing "Why?" chain, and the answer goes with a request to the AI to fix the design or example. It runs in the browser, with no AI and no cost.
How
if/casedecision with the branch taken (SimResult::decisions, capped atMAX_DECISIONS, withdecisions_cut) and maps branches to decisions (cover_decision).Origin::writesnames the signal an assignment writes, andCond::pointnames its branch.apps/web/src/lib/why.ts:whyNot()finds the candidate lines, walks their decisions at the last moment they were made, and reports the first one that went another way.Checked
writes.cnt == N - 1(cnt = 2), and clickingcnt = 2continues the "Why?" chain. The test example was restored afterwards.statematched one of the listed values (state = 2)").-D warnings, workspace tests, web typecheck and build.Docs: user guide (design view), architecture, CHANGELOG.
Initiated by DigitalTwin Technology GmbH.
🤖 Generated with Claude Code