Skip to content

Fix A/X register clobbering in net.asm, add DNS + HTTP integration tests - #9

Merged
JC-000 merged 4 commits into
masterfrom
fix/net-asm-ax-clobber-and-integration-tests
May 6, 2026
Merged

Fix A/X register clobbering in net.asm, add DNS + HTTP integration tests#9
JC-000 merged 4 commits into
masterfrom
fix/net-asm-ax-clobber-and-integration-tests

Conversation

@JC-000

Copy link
Copy Markdown
Owner

Summary

  • Bug fix:net_dns_resolve and net_set_tcp_dest in net.asm both passed A/X register parameters through net_save_zp, which clobbers A/X via its LDX loop counter. DNS queries sent garbage pointers and TCP destination setup was silently corrupted. Fixed by pushing A/X to the stack before the ZP save and restoring after.
  • New test:test_dns.py — 4 tests exercising net_dns_resolve over TAP with dnsmasq (known host, second host, unknown host, label check)
  • New test:test_http_integration.py — 5 tests for end-to-end plain HTTP GET over TAP (DNS → TCP connect → send request → parse response → verify server-side request log)
  • Test server:test_server.py — reusable HTTP server returning HELLO C64 for integration tests
  • README: Mark HTTP/1.1 GET as complete, document new integration tests

Key decisions

  • Integration tests run unprivileged (only dnsmasq launched via sudo), matching the c64-test-harness pattern where TAP interfaces are pre-configured and owned by the regular user
  • ethernet_mode="rrnet" (not "tfe") — ip65 build expects RR-Net cartridge mode
  • transport.resume() called after wait_for_text() before inject_keys() — binary monitor pauses CPU on screen reads

Test plan

  • python3 tools/run_all_tests.py --skip-slow — 182/182 pass (no regressions)
  • python3 tools/test_dns.py — 4/4 pass
  • python3 tools/test_http_integration.py — 5/5 pass

🤖 Generated with Claude Code


Originally posted by @JC-000 on 2026-03-29

JC-000and others added 4 commits March 23, 2026 15:39
…erged
The harness wait_for_text() now calls transport.resume() between polls
internally, so the inline polling loops are no longer needed. This
replaces 13 copies of the same ~10-line loop with single wait_for_text()
calls, reducing total code by 120 lines.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r reuse
The parallel runner had two bugs: (1) as_completed() didn't see futures added
mid-iteration, so only the first N suites were collected, and (2) reusing VICE
instances across suites caused state contamination (HKDF 0/12 on reused workers).
Fix: allocate a fresh VICE instance per suite via run_suite_in_own_instance().
Add all 10 suites (was 5). Add --skip-slow and --seed flags. 193/193 pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix parallel test runner: all 10 suites, instance-per-suite.
… tests
net_dns_resolve and net_set_tcp_dest both passed A/X parameters through
net_save_zp, which uses X as a loop counter and clobbers both registers.
This caused DNS resolution and TCP destination setup to receive garbage
pointers instead of the caller's intended addresses. Fixed by pushing
A/X to the stack before the ZP save and restoring after.
Added test_dns.py (4 tests) exercising net_dns_resolve over TAP with
dnsmasq, and test_http_integration.py (5 tests) for end-to-end plain
HTTP GET (DNS → TCP → request → response). Both use ViceInstanceManager
with ethernet_mode="rrnet" and run unprivileged (only dnsmasq via sudo).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JC-000
JC-000 merged commit f52c4f9 into masterMay 6, 2026
@JC-000
JC-000 deleted the fix/net-asm-ax-clobber-and-integration-tests branch May 6, 2026 19:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@JC-000