Repository navigation
Conversation
|
The rounding case occurs on a retail index. With 12,101 translated pixel shaders from my Xbox 1.0.2.1 copy (15 strata), Across the feasible request range (146–12,101 for this index), the initial proportional allocation fell short at 355 sizes: by one at 318 sizes, by two at 36, and by three only at 10,600. I exercised the sampler for each shortfall magnitude, the stratum floor, and the population cap. It hit the expected count and preserved each stratum’s minimum in those cases. CPU-only on CachyOS, AI-assisted. |
|
Tested a5a1ff5 merged with main 561b65a on Linux (WSL2) / Python 3.12.16 (-I): pass tests/test_ps_sweep.py: 13 run, 13 passed, 0 failed. Negative control: with tools/ps_sweep.py restored from upstream/main the new test_rounding_down_still_gives_n fails (24 != 25), 12 other tests pass; restored the fix and it passes again. Diff read: the top-up loop is bounded by min(n, total) and only picks strata with room, so it terminates. |
Claimed in #5781 (#5781 (comment)); no item ID, a new finding.
What changed and why
pick_samplegives each stratumround(n * size / total)shaders and only corrects a sum aboven. When the shares round down (two strata of 50 with n=25 make 12 + 12) or a stratum is taken whole, the sample came out below thenthat the docstring anddocs/shader_validation.mdpromise. The shaders still missing now go, one at a time, to the strata furthest below their proportional share.The documented 480-shader sample (seed 20261122) is unchanged, because there the sum already equals
n: on my own work folder the old and new functions return identical lists for n = 480, 200 and 1000.Tests (Windows 11, Python 3.12, CPU only, no game files)
python -I tests/test_ps_sweep.py: 13 OK. The newtest_rounding_down_still_gives_nfails onmain(24 != 25).python -m compileall -q make_game.py tools tests: clean.Not done
run/comparepaths were not run; the change is in the sample allocation only.ps_sweep.pyand may conflict aroundpick_sample. Thems_sweep.pycopy in TEST: run a stratified sample of translated mesh shaders natively and as --mesh-compute and compare (vk_ms_sweep, tools/ms_sweep.py) #5072 has the same rounding and is not changed here.AI-assisted (Claude Code).