test(lift): test_vbytes and test_vfpx_elem run in seconds, not minutes (fewer random states) #1876
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1876
Loading…
Reference in a new issue
No description provided.
Delete branch "Veix/Longshot:fix/faster-vector-checks"
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?
Summary
tests/test_vbytes.pytakes about 25 minutes, so it times out intests/run_all.py(600 s a check). This brings it down to 28 s, andtests/test_vfpx_elem.pyfrom 67 s to 11 s, by running fewer random states. What they check is unchanged.test_vbytesran 1,000,000 random states for each of its 130 guest words, on four builds. Now it runs 10,000, which is still 1.3 million checks a build, with the index bytes biased to the edges as before. A planted off-by-one ina64_tbl1(0x70as0x71, so index 15 reads 0) is caught at once at 10,000: 91,240 mismatches.test_vfpx_elemgoes from 2,000,000 to 200,000 states; its sweep of every pair of special values is unchanged.Both checks came with #1576 (mine); the defaults were never meant to take this long.
See #1576
Testing
Tested: Windows 11, Ryzen 9 9900X:
python -I -B tests/run_all.py test_vbytes test_vfpx_elem test_fpx_stickypasses (28.1, 10.8 and 18.3 s). Witha64_tbl1's0x70changed to0x71,test_vbytesfails with 91,240 mismatches. No game run: only the checks change.Still to test:
python -I -B tests/run_all.py test_vbytes test_vfpx_elem, expecting both to pass well under 600 s (@Beanstalk, or by hand)Measurements
Baseline: main @
89c3d21e, the same checks at their old defaults on the same PC.Verdict:
test_vbytes25 min (it timed out at 600 s in the suite) to 28 s,test_vfpx_elem67 to 11 s.89c3d21e138723cetest_vbytestest_vfpx_elemRisks
What could break: a bug that shows only in a rare random state the smaller count misses; the edges are biased in, a planted off-by-one fails at once, and
--randomstill runs any count by hand. Turning it off:--random 1000000(or2000000) as before. After updating: nothing changes for players.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). [on Windows: the checks this changes pass; the 50 others that fail on this PC fail the same onmain@89c3d21e]main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.Written with help from Claude Code (Claude Opus 5.5).
Possibly related, for context:
#1818 also lowers
test_vbytes' count, for its runner (50,000 states); this is the small fix that can land first. If both land, #1818'sRUN_ALL_ARGSline could go or use 10,000: a planted off-by-one ina64_tbl1fails at once at 10,000.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.