fix(test): open sound.pak once, not once per call #58
Reference in New Issue
Block a user
Delete Branch "fix/slb-suite-one-archive"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by actually running the documented baseline on
fabi-Hyrican-PC: it does not reproduce.cargoexits 101, and the run reports 44 suites / 367 passed / 0 failed against the documented 45 / 377 / 0.The failure mode is the interesting part
slb_leading_segment_discwas SIGKILLed (signal 9) — the OOM killer. ⚠️ A killed suite prints notest result:line at all, so it does not fail visibly, it disappears from the tally. The run still said0 failed— true, and completely useless. The only honest signal is cargo's exit code.That also explains the arithmetic exactly: 367 + 10 = 377, 44 + 1 = 45.
Cause, measured
PakArchiveholds the entire concatenated payload in memory, andsound.pakis 1.01 GB (sound.p00–.p04):--memory-swap==--memory, so no swapbank()andbank_named()opened the archive on every call, inside loops, and five more tests opened their own — ~26 opens for a suite of 10 tests.Fix
One
OnceLockarchive for the binary. It is immutable once open and every accessor takes&self, so one shared instance is equivalent to N private ones at 1/N the memory.Measured in the capped container, 7 GB, default threads
cargo fmt --checkcargo clippy --tests -D warningsThe ~7× speed-up is a side effect: it no longer re-reads 1 GB from disc 26 times.
Why it matters beyond this box
It makes the baseline reproducible at the default
SYLPH_CI_MEM_GB=7instead of needing the 31 GB machine's=14, and removes a suite that could silently vanish from any future run.