fix(sim): PushButton/Monoflop Reset handling; InputRef output mirroring - #15
Open
discostu105 wants to merge 2 commits into
Open
fix(sim): PushButton/Monoflop Reset handling; InputRef output mirroring#15discostu105 wants to merge 2 commits into
discostu105 wants to merge 2 commits into
Conversation
The parser signature for PushButton/PushButton2/PushButton2Sel only mapped InputTrigger and On, so a wired Reset landed at an input index the eval never read — a PushButton driven off via Reset stayed on forever. - parser: add Reset + InputDisable to the PushButton and PushButtonSel input signatures (synthesized when absent, so layouts stay stable) - interpreter: Reset dominates On and forces off; InputDisable gates the trigger edge (PushButton and PushButton2; assumed behavior, flagged) - JIT: same semantics in EvalStep::PushButton (usize::MAX sentinel for absent connectors) so interpreter/JIT equivalence holds Found while simulating the r50 UV-lamp weekday scenario (PushButton with On: weekday-Or, Reset: Not(weekday-Or)).
…d AQ - Monoflop: the parser signature lacked Reset, so a wired Reset was never read and a running pulse could not be aborted. Reset now clears the countdown and blocks retriggering while held (interpreter + JIT; assumed behavior, flagged). - InputRef: the impl forwarded I->Q and AI->AQ separately, but the Miniserver mirrors the one fed side onto BOTH outputs — the r50 corpus wires 'ref.AI <- mem.AQ' with consumers reading ref.Q. Q is now the digital view (non-zero -> 1) and AQ the analog value of whichever side is fed. Found while simulating the r50 alarm chain (Monoflop 'alarm_halten' with Reset: heimkommen_ref.Q, triggered through an AI-fed InputRef).
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.
Three simulator correctness gaps, found while simulating scenarios from a real Miniserver config (weekday-gated pool UV lamp, alarm hold chain) and fixed in both the interpreter and the JIT compiler so their equivalence holds.
PushButton / PushButton2: Reset and InputDisable were ignored
The parser signature only mapped
InputTriggerandOn, so a wiredResetconnector landed at an input index the eval never read — a PushButton driven off via Reset stayed on forever.Reset+InputDisableadded to the PushButton/PushButton2/PushButton2Sel and PushButtonSel input signatures (synthesized when absent, so existing layouts keep their indices)EvalStep::PushButton, with ausize::MAXsentinel for absent connectorsMonoflop: Reset input missing from the signature
A wired Reset was never read, so a running pulse could not be aborted. Reset now clears the countdown and blocks retriggering while held (interpreter + JIT).
InputRef: mirror the fed side onto BOTH outputs
The impl forwarded
I -> QandAI -> AQseparately, but the Miniserver mirrors the one fed side onto both outputs — real configs wireref.AI <- mem.AQwith consumers readingref.Q.Qis now the digital view (non-zero → 1) andAQthe analog value of whichever side is fed.Notes
WARNING: Assumed behavior — not validated against Miniservercomments in the code, following the dominance order that matches observed behavior in the configs I simulate; happy to adjust if you have reference traces.lox-simsuite passes (498 tests).