Skip to content

Add a JiffyDOS LOAD soak that reproduces #986 on the Software IEC drive - #1132

Open
JC-000 wants to merge 4 commits into
GideonZ:masterfrom
JC-000:test/986-jiffy-load-soak
Open

JC-000 wants to merge 4 commits into
GideonZ:masterfrom
JC-000:test/986-jiffy-load-soak

Conversation

@JC-000

@JC-000 JC-000 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Test only, no firmware change. Adds a soak test that reproduces the intermittent silent short LOAD of #986 on the Software IEC drive under JiffyDOS. It is the formal version of the tests asked for in #1130.

What it does

tests/soak/io/iec/jiffy_load_soak_test.py runs a small C64 program that LOADs a file from the Software IEC drive many times and records, for every load, the ST byte, the end address, a checksum and the drive's error channel. It sets the device settings it needs and restores them afterwards.

  • --host-delay CYCLES --jiffydos-rom PATH patches a copy of your own JiffyDOS 6.01 kernal so the host polls DATA later at the start of each chunk, to imitate a slower host. No JiffyDOS image is shipped or kept.
  • --partition-path DIR serves the file from a USB stick. The failure has only been seen from USB storage, not from the /Temp RAM disk.
  • jiffy_load_test.py is device-free and checks the patch site, the cycle count of the delay and the C64 program's layout.
  • run-tests gets jiffy-load (device-free) and jiffy-load-soak (plain soak without a delay, which passes).

What it shows today

Ultimate 64 Elite, 16 KiB file on a USB stick, blocks of 50 loads:

Extra host delay master master + the 100 us hold of #1130
63 cycles 7/150 failed 9/150 failed
88 cycles 0/50 0/50
none 0/50 0/50

Every failure is ST=66 with 00, OK on the error channel, nearly always at the first chunk, and the failures come in bursts. The cause is not established and this PR does not claim a fix. The delayed row is run by hand and is expected to fail intermittently until one exists:

tests/soak/io/iec/jiffy_load_soak_test.py -H u64 --jiffydos-rom ~/roms/JiffyDOS_C64.bin \
  --host-delay 63 --partition-path /USB1/soak --iterations 100

Tested

  • jiffy_load_test.py: 13 checks pass.
  • At this head on an Ultimate 64 Elite: 20 of 20 loads clean without a delay; 3 of 50 failed with a delay of 63 cycles, all ST=66 at the first chunk.
  • tools/docs/update_test_docs.py --check reports the generated block unchanged.

Not run on a C64 Ultimate or an Ultimate II+.

Written with Claude Fable 5.2 and Claude Sonnet 5.5 in Claude Code.

🤖 Generated with Claude Code

JC-000 and others added 4 commits November 23, 2026 20:17
A C64 program LOADs one file from the Software IEC drive N times with the
KERNAL's own LOAD and records, for every load, ST, carry, the error channel,
the end address and a checksum over a load area it filled beforehand. The
host totals clean loads, ST failures (with their ST values), loads that
reported success with the wrong data, error statuses and hangs. This
formalises the evidence of GideonZ#1130 for GideonZ#986: ST=66 with 00, OK on the error
channel.

--host-delay reproduces the rows that slow the JiffyDOS host on purpose. It
patches a temporary copy of the user's own JiffyDOS image, refuses an image
whose LOAD routine is not the one the patch is written for, and ships no ROM.
--partition-path serves the file from another directory, such as a USB
stick, through the UCI SoftIEC target, because the failing rows need it.

The suite sets the settings it needs, records them, and restores them, the
drive's directory, its folder, its partition and the KERNAL copy at the end.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The run-tests entry is now a plain JiffyDOS/SoftIEC LOAD soak with --profile
stress|soak like softiec-soak (--iterations overrides); the README says that
the red/green row for GideonZ#986 needs a USB partition, --host-delay and the user's
own JiffyDOS image, and why the Temp RAM disk passes it on both firmwares.

The results region is zeroed before each upload, so a program that did not
start cannot be counted from stale memory. The wait for a batch comes from
clean loads only, so an all-fail batch no longer makes polling halt the CPU.
Teardown is three separate steps, the folder counts as created only after
mkd succeeded, and the drive goes back to the partition G-P says it was on.

The host delay is the net number of cycles added: the routine costs 5n+11, the
JSR 6, the replaced ORA/TAX 4, so 13+5n. The code was right and the text said
11+5n; 10, 15 and 18 passes are 63, 88 and 103, not 61, 86 and 101. A
device-free check counts the cycles from the routine's own opcodes.

tests/README.md differs from its base only by this suite's rows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The delayed sample follows the host releasing DATA, not the drive. Give the
RAM-disk rows in net cycles (63, 103, 153) and use a neutral example path.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A controlled A/B on an Ultimate 64 Elite (USB stick, 16 KiB file, JiffyDOS
6.01 patched to delay the first DATA poll, alternating blocks of 50 loads)
showed the delay-63 row fails intermittently, in bursts, on master and with
the 100 us hold of GideonZ#1130 alike: 7 of 150 and 9 of 150 loads. Delay 88 and no
delay passed 50 of 50 in both. The failures are silent short loads (ST=66,
error channel "00, OK"), nearly all at the first chunk. The cause is not
established and no fix is known.

Reword the README, the test's docstring and the run-tests comment so they
present the soak as a reproducer for GideonZ#986 and state these figures, instead
of describing it as evidence for a fix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to 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