Repository navigation
Conversation
|
Tested on Apple M1 Max, macOS 27.2.1 arm64, MoltenVK 1.4.2: pass (with a platform caveat).
No game files. AI-assisted (Devin). |
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Independent Windows review (commit \e3edd59a185fcec8f652db23f67c8f5e00739e2a)
What changed:
- \ ools/rdna2spirv.py:
- Resolves location collision where \gen.bary_location\ assigned slot numbers already reserved by \16_half_locs.
- Fixes the allocation check to compute \occupied = used | reserved, preventing collisions between %bary\ and reserved 16-bit half slots.
- \docs/shader_validation.md:
- Documents the barycentric coordinate allocation contract and root-cause analysis for BUILD-1447.
- \ ests/semantic/test_bary_fallback.py:
- Adds regression test suite for half-slot barycentric location assignment.
Verification:
- Ran \python -I -m unittest discover -s tests/semantic -p test_bary_fallback.py: 15/15 OK.
- Pure standard library / Python, clean git diff, zero game files.
Ready for merge.
|
Tested Environment notes: pre-built Semantic tests:
RTX 3050 GPU runs (
|
|
Tested
All three runs are test by test the same as What this does not show: none of the hand-written fixtures changed its result under the fallback, so the |
Claimed in the coordination issue as: BUILD-1447 (#8047 (comment))
What and why
#4847ps_sweepdifferences between the default and fallback translations on all480sampled PS (--seed 20261122, variantz,maindde82f27e) and across all12,101PS on an AMD Radeon RX 6650 XT:29of12,101PS declareMinLod(image_sample_d_cl,273occurrences), and0of the480sampled PS useMinLod, so the MinLod fallback plays no part in this480-shader difference.480sampled PS,272modules are byte-identical acrossdefault,--bary-fallback, and--bary-fallback --f16-interp-fallback,10are refused (computed I/J pair under --bary-fallback), and198differ (186v_interp_*_f16all usinghigh,12raw barycentrics needing.bary_gs.spv,0combining both in the sample).--bary-fallbackalone, all63differing/NaN/zero draws (54beyond tolerance:53gross>0.1,1moderate>1e-2;8NaNondefaultonly;1zero ondefaultonly) arev_interp_*_f16shaders: the default sweep VS withoutf16_halveswrites[0, 1]smoothf32outputs thatdefaultunpacks per vertex viaPerVertexKHRUnpackHalf2x16into negative or largef16values (feedingsqrt/log/pow), whereas--bary-fallbackalone reads the positive smoothf32values directly.198shaders with--bary-fallback --f16-interp-fallbackgives153/153completing draws (141v_interp_*_f16+12raw-bary GS,573/573targets) bit-for-bit identical againstdefault(ps_sweep.py compare --exact), with0differences and0NaN/zero mismatches (12driver crashes on both0xC0000005unchanged with an 8 MiB stack,33timeouts). All3/5translatable whole-corpus PS combining raw barycentrics andv_interp_*_f16also matchdefaultbit-for-bit (3/3draws,11/11targets) on the RX 6650 XT.%baryinput location allocation intools/rdna2spirv.py(assemble()) to skipoccupied = used | reservedinstead ofusedalone, preventing%baryfrom colliding with an unread reservedf16_halvesproducer slot when combining--bary-fallbackand--f16-interp-fallback.tests/semantic/test_bary_fallback.py(BaryAndF16FallbackInteraction) covering--bary-fallbackdivergence vs--bary-fallback --f16-interp-fallbackequivalence,%baryslot avoidance past unreadreservedf16_halvesslots (29->30), and combined raw-barycentric +f16interpolation with.bary_gs.spvvalidation.docs/shader_validation.mdanddocs/design.md.Tested
32.0.21045.29003, Vulkan SDK1.4.363.1(SPIRV-Tools v2026.4).ps_sweepon the RX 6650 XT (480sampled PS,198differing modules, variantz,--timeout 30):defaultvs--bary-fallbackalone:90OK on both (12GS +78f16),54differ (53gross,1moderate),9NaN/zero ondefaultonly (8NaN,1zero),12fail on both (0xC0000005),33timeout.defaultvs--bary-fallback --f16-interp-fallback:153OK on both (141f16+12GS),0differ,0NaN/zero mismatch,12fail on both,33timeout;153/153completing draws (89non-clear exact +64clear-only exact across573/573targets) bit-exact underps_sweep.py compare --exact.v_interp_*_f16:3/3draws (11/11targets) bit-exact on the RX 6650 XT (2/5refused forcomputed I/J pair under --bary-fallback).spirv-valcounts before vs after (SPIRV-Tools v2026.4):--limit 200slice (default): before200translated /200spirv-val-valid; after200translated /200spirv-val-valid (0regressions).--limit 200slice (--bary-fallback --f16-interp-fallback): after200translated /200spirv-val-valid (0regressions).v_interp_*_f16subset (5shaders): before3translated /3spirv-val-valid (2refused); after3translated /3spirv-val-valid (2refused),0regressions.occupiedtousedintools/rdna2spirv.pycausedtest_bary_location_avoids_unread_reserved_f16_half_slotto fail withAssertionError: {'location': 29} != {'location': 30}.python -m compileall -q make_game.py tools tests(exit0)python -m unittest discover -s tests/semantic -p test_bary_fallback.py -v(15 tests,OK,spirv-as/spirv-valactive,0skipped)python -m unittest discover -s tests/semantic -p test_f16_interp_fallback.py -v(15 tests,OK)python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_bary_fallback.py docs/shader_validation.md docs/design.md(exit0)test_interp_p1lv_f16.py(36/36),test_interp_f16_high.py(5/5),tests/test_ps_sweep.py(23,3skipped).tests/test_docs_cli_flags.py&tests/test_docs_design_rows.py:8 passed, edited files clean (the 2 remaining failures are pre-existing onmainindocs/embedded_shaders.mdanddocs/README.md).python -I scripts/run_semantic_tests.py tests/semantic:447 files, 5960 tests(444passed;3pre-existing unrelatedmainfailures:test_image_atomics_guard,test_image_cube_store_glc,test_image_store_d16).AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed.