Repository navigation
feat(tutorial): check a circuit over time steps - #104
Merged
Merged
Conversation
…at went wrong A sequential check works out what the outputs should be at each step from a model of the circuit and the inputs fed to it. Check then simulates the steps in turn, carrying the flip-flops on from the step before, and reports the first step at which an output is wrong with the inputs at that step. A stage cleared this way says up to which step it works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tep" in English A stage whose steps feed an input of the wrong width, or expect an output to change width, now fails where it is defined instead of looking like a mistake in the player's circuit. In English, "step" alone could be read as one of the numbered Steps of the stage. Tests now cover that a combinational check starts every combination afresh, and the text of a failure at a step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with
|
| Latest commit: |
6596b1b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://874ef41b.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
| Branch Preview URL: | https://feat-sequential-check.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
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.
Summary
Stages 7 to 9 (the counter, a decimal digit and MM:SS) build circuits whose outputs change over time with flip-flops. Check simulated every input combination from scratch, so a flip-flop always output 0 and such a stage could never be cleared. This PR adds a check over time steps for those stages. No stage uses it yet, so nothing on the screen changes.
sequentialCheck(pins, model, inputSteps)works out what the outputs should be at each step from a model of the circuit (its state, and for each step the outputs and the next state) and the inputs fed at each step.checkCombinationalis renamedcheckCircuit, and the two wrong-output messages share how they label values.Not in this PR
goalTableOfreturns null, marked TODO). The counter stage decides how its goal looks.Testing
npx vitest run(218 tests),npx tsc -p .andnpx biome check srcpass. New tests cover:describeFailurefor a wrong step🤖 Generated with Claude Code