Repository navigation
docs/design.md: one copy of each rule in the 16-bit interpolation without PerVertexKHR row - #4903
LouisRiverstone wants to merge 1 commit into
Conversation
…hout PerVertexKHR row The row held four versions of its location rule: the pre-SHADER-291 one (halves at 29 - 2N / 30 - 2N), the SHADER-291 one (28 - 2N / 29 - 2N), and two producer-room sentences disagreeing on (28 - P) / 2 vs (29 - P) / 2, one of them saying a colliding PS is rejected where the newer one (and the code) packs it. The SHADER-378 dynamic-packing sentence was split at an unescaped |F|, its second half spliced into 'Not combined with --bary-fallback'. The code fixes the numbers: F16_HALF_TOP = 29, f16_half_location(n, h) = 28 - 2n + h, and its comment's room for params 0..(28 - P) / 2; assign_f16_half_locations packs collisions. The row now keeps the SHADER-291 / (28 - P) / dynamic-packing versions, the SHADER-378 sentence whole, and one Unverified list with every item the copies named. No behaviour change.
whattheflop
left a comment
There was a problem hiding this comment.
Independent CPU check of the edited contract, AI-assisted, with uv CPython 3.12.13. Ten synthetic producer counts (including odd/even boundaries at 27, 28 and 29) agreed with the floor of (28 − P)/2 for the highest reserved pair. Eight fragment allocation cases covered canonical pairs, raw-output collisions, the negative canonical location for parameter 15, and the full budget boundary. With exactly two free locations the remaining pair fit; with only one free it returned Unsupported. Repacked locations were distinct and within 0–29.
The revised row retains the barycentric-GS limitation and distinguishes the location window checked here from the device's output-component limit. This checks allocator behavior and the documentation, with no GPU or game inputs. Whitespace check passed.
|
Thanks @whattheflop for exercising the allocator itself: the ten producer counts agreeing with (28 − P) / 2 at the 27/28/29 boundaries, the repacking cases, and the one-free-location |
|
Tested eb16962 merged with main 3faac55 on Linux, Python 3.12.16: pass All 10 tests/test_docs_*.py pass (exit 0). Docs-only (one line of docs/design.md, the "16-bit interpolation without PerVertexKHR" row); no code, so no new test and no negative control applies. Content check, comparing every sentence of the old row with the new one: nothing lost that is still true. Dropped only (a) the stale 29 - 2N / 30 - 2N half-location sentence, superseded by the 28 - 2N / 29 - 2N rule (SHADER-291) that the PR keeps and that matches assign_f16_half_locations in tools/rdna2spirv.py, (b) the stale "a PS whose decoded-half location collides is rejected (Unsupported)" sentence, superseded by the dynamic packing text that stays, (c) the duplicate "fewer than 31 output locations" Unverified items (the 124-components one stays), (d) the duplicated SHADER-378 paragraph, which had a broken mid-sentence splice ("2· ... | F | <= 29 - max"); the kept copy has the correct escaped 2·|F|. All other Unverified items are still listed once (producer with too many params, MoltenVK validation run, MeshEXT, 124 components, geometry shader note). No issues found. |
|
APPROVE. One line at Claim-level diff: the only token lost is Docs tests 30 passed, but Approve. AI-assisted review, docs only. |
|
Verified against main 3faac55: the dedup removes genuinely stale clauses from the 16-bit-interpolation row — main still carries the old 30-2N location scheme variant (verified: present on main, absent in the PR) and repeated copies of the producer/drop sentence, while the retained text is the post-SHADER-291/378-correct variant (28-2N/29-2N, dynamic packing). test_docs_design_rows.py and test_docs_table_rows.py pass with the row as rewritten, so the row is needed, not superseded. No overlap with #4899, which dedups other rows. CI pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
The row I left out of #4899 because its copies disagree on a number. The code settles it.
"16-bit interpolation without
PerVertexKHR(--f16-interp-fallback)" (8,031 → 5,960 characters) had four versions of its location rule:29 − 2N/30 − 2N, "below MoltenVK's 31 locations".28 − 2N/29 − 2N, "so nothing goes above location 29".0..(28 − P) / 2, the other0..(29 − P) / 2. One says a colliding PS is rejected (Unsupported); the newer one says it is packed into free locations (SHADER-378).The code decides it:
F16_HALF_TOP = 29,f16_half_location(n, h) = 29 − 2n − 1 + h(=28 − 2n/29 − 2n), and the comment next to it: "a producer with params 0..P-1 has room for the halves of params 0..(28 - P) / 2".assign_f16_half_locationspacks collisions instead of refusing them. So the row keeps the SHADER-291 sentence, the(28 − P) / 2+ dynamic-packing sentence, and drops the other two.Also fixed:
|F|. Its second half (mesh_compute_vs.py'spair_f16_halves, the runtime'sspirv_f16_halves.hrelocation and synthesis) had been spliced after "Not combined with--bary-fallback's geometry shader.", and its first half appeared twice. It's whole again, with the pipe escaped.MeshEXTPSOs, and devices with fewer than 124 output components. "Fewer than 31 output locations" is dropped, since it's the same bound as 124 components.All measurements, attributions and test lists stay.
Checked:
tools/rdna2spirv.py(F16_HALF_TOP,f16_half_location,assign_f16_half_locations)|inside the celltests/test_docs_*.pychecks passDocs only, no game files. Claimed on #4816 (with the #4899 claim, which named this row as needing the code).
AI-assisted (Claude Code): I reviewed and ran the checks.