Repository navigation
test_typed_target: restore A/X/Y around each hijacking call - #283
Merged
Merged
Conversation
jsr() puts back PC/SP/FL after the call but leaves A/X/Y as the routine returned them. Every case after the first refusal resumes main_loop and then halts it at a random instruction. Halted on net_poll's `cmp #NET_TCP_CONNECTED` after a refused do_https_get, A is the driver's carry, 1 = NET_TCP_CONNECTED. The resume then polls a socket VICE does not have, net_poll latches net_tcp_state = ERROR, and cold_call's busy guard refuses every later prompt (COLD BANK FAIL, cold_err = 9). That is the 92/139 and 108/139 cascade on uci-comb, and the 139/139 runs where the halt missed that instruction. Test defect, not product: nothing on a real machine changes A between those two instructions. Red-green evidence: parking the CPU at net_poll+3 before a refused case gives net_tcp_state=2 and cold_err=9 on the next case (9/12) without this change, and 12/12 with net_tcp_state=0 with it. Full suite on uci-comb: 139/139, three runs out of three. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
JC-000
added a commit
that referenced
this pull request
Oct 6, 2026
…dv-d2 F3) In VICE the trust store read fails (no UCI), so trust_pre asks CONTINUE UNPINNED? Y/N before the dial, after flushing the key buffer; the suite never answered and hung on every shipped TRUST_STORE image. On those images do_https_get now runs until it returns or parks on the question, types Y (so every accepted target still reaches the dial stub), and checks that it was asked; a refused target must never be asked. One more case answers N: NOT DIALLED, nothing dialled. call() is untouched (#283). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
JC-000
added a commit
that referenced
this pull request
Oct 6, 2026
…dv-d2 F3) In VICE the trust store read fails (no UCI), so trust_pre asks CONTINUE UNPINNED? Y/N before the dial, after flushing the key buffer; the suite never answered and hung on every shipped TRUST_STORE image. On those images do_https_get now runs until it returns or parks on the question, types Y (so every accepted target still reaches the dial stub), and checks that it was asked; a refused target must never be asked. One more case answers N: NOT DIALLED, nothing dialled. call() is untouched (#283). Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Mechanism
test_typed_target.pyon uci-comb could fail a different, random number of cases on the same PRG: 139/139 on one run, 92/139 and 108/139 on others. Every refused case after a certain point printedCOLD BANK FAILwithcold_err = 9(COLD_R_BUSY).jsr()restores PC, SP and FL after a call. It does not restore A, X or Y.main_looprun for 3 s. The next case then halts the CPU at a random instruction and calls into the program from there.net_poll'scmp #NET_TCP_CONNECTED(src/net/uci/net.s, right afterlda net_tcp_state), A comes back holding the suite driver's carry.do_https_getthat carry is 1, which isNET_TCP_CONNECTED.net_polltries to read a socket that VICE does not have, andnet_tcp_statestays at ERROR from then on.cold_call's busy check (src/net/uci/cold_bank.s) then turns down every later prompt.The busy check is behaving correctly; the test was handing it a wrong socket state. On a real machine nothing changes A between those two instructions.
Fix:
call()saves the registers beforejsr()and puts A, X and Y back afterwards.Evidence (master 249f65d, uci-comb, VICE)
net_poll+3before a refused case:net_tcp_stategoes 0 → 2, and the next case getscold_err=9and fails 3 of 6 checks (9/12).net_tcp_statestays 0,cold_err=0, 12/12.Only the test changes. No product source changes, so no PRG changes.
🤖 Generated with Claude Code