Lower v_cvt_pk_u8_f32 in the startup gfx2hlsl translator #2094
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2101"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T00:21:27Z.
Lower
v_cvt_pk_u8_f32intools/startup/gfx2hlsl.py(item K of #2023).What it does
v_cvt_pk_u8_f32 D, S0, S1, S2(VOP3A opcode 350) inserts a byte into S2:The RDNA 1.0 and RDNA 2 ISA guides do not define
flt32_to_uint8: rounding, bounds, NaN and negative results are not stated. I did not find a source for them that I could cite, so this PR does whattools/compute_store_aot.pyalready does for the same opcode (#1546, #1592): it holds only where every reading agrees, an S0 that is +0.0 or an integer in [1, 255].clamponly keeps the conversion defined; it is not a claim about the hardware.I did not add rounding at x.5 or clamping below 0 and above 255 to the fixture, because the reference would be a guess. If a maintainer can point to the hardware behavior, that is a follow-up.
Test
tests/startup_gfx2hlsl_cvt_pk_u8_check.py, source-built (no retail bytes), on the sharedstartup_gfx2hlsl_lane_alu.pyrunner:llvm-mcreassembly of the pixel bodies.Wired in
CMakeLists.txt(controls, warp, hardware) and.github/workflows/windows.yml.Verified here (Linux)
The new check (no arguments and
binarywith llvm-mc), everytests/startup_gfx2hlsl_*_check.py,tests/startup_translator_check.py,tests/docs_links_check.pyandgit diff --check. The D3D12/WARP draw does not run on Linux, so thedrawmode is untested; the CTest entries need a Windows run.Refs #2023 (item K)
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T00:54:51Z.
Review: CHANGES_REQUESTED
The four in-domain draws and both mutations passed on WARP and RTX 4060 Laptop. The generic startup path still accepts an arbitrary register for S0 and clamps it, with no proof or explicit profile contract that it contains only +0.0 or integers 1..255. A computed fraction, NaN or negative value can now silently select an invented byte. Please restrict the default path to proven in-domain words, or add an explicitly selected fixture/profile contract with a rejection for unproven operands in ordinary translation. Keep the four selector checks and the dropped-S2 control.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T00:29:56Z.
Six mutations: four caught, two survivors — and one of them I expect to change the drawn word, so I would like your read before I claim anything
Baseline on this branch, both paths run here (Windows 11 build 26300.9974, DXC 10.0.26100.0):
op_v_cvt_pk_u8_f32shiftpinned to0u(ignore S1)resthigh bits no longer preserved ((rest & ~(0xff<<s)) |→(rest |)len(ops) != 4→!= 3clamp(F(x), 0.0, 255.0)→0.0, 256.0& 0xffu→& 0x1ffuThe clamp survivor is fine, and here is why I am not calling it a gap
Under this lowering's stated contract the source is
+0.0or an integer in1..255, and outside that the ISA'sflt32_to_uint8is undefined. Clampingat 256 instead of 255 can only differ for inputs in
(255, 256], which the contract excludes. So it is an equivalent mutant relative to theprecondition — but the constant is a documented choice, and a one-line text assertion (
'0.0, 255.0' in text) would pin it for free. Your call.The mask survivor is the one I would like explained
((rest & ~(0xffu << s)) | ((x & 0xffu) << s))→... ((x & 0x1ffu) << s). For your own first draw vector:correct: clear the low byte of
rest→0x55aa3300, insert0xff→0x55aa33ffmutant: clear nine bits →
0x55aa3200, insert0xff→0x55aa32ffDifferent word, and bit 8 of
rest(0x33cc→ LSB of0x33is 1) is exactly the bit the wider mask eats. Yet the draw stayed green when I appliedit. I checked that the mutant reaches the emitted text — the assignment becomes
so one of three things is true, and I could not settle which in the time I had:
check_drawcompiles thegoodshader from a translation that is not the live one after the mutation —translate()buildshlsl_ps()at call time,so I would expect it to be live, which is why this is a question rather than a claim;
If it is (2), then the draw half is not a control against lowering mutations at all, which would matter beyond this PR. If it is (1), ignore me.
The thing this PR gets right that I want to write down
Refusing a constant
S0outside{+0.0} ∪ [1,255]is the correct shape of answer for an instruction whose own guide leaves the conversion undefined:the translator states the precondition it needs instead of guessing a rounding rule. That is the same call I made in #2092 for
class16, and it ismuch easier to defend in review than a plausible-looking
round().AI-assisted; the six mutations, both check modes and the HLSL dump above were run locally.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T00:30:43Z.
Narrowing my own question: the mutant does reach the compiled pixel shader
I said I could not tell whether the draw half compiles the live lowering. That part is now settled, and it makes the survivor more interesting rather than
less:
So
translate()is live, the mutant lands in thegoodshader's text, and the draw still reported2 draws matched. Whatever is responsible is thereforedownstream of the translation — in
compile_hlsl, in the renderer's comparison, or in my hand computation of the expected word.For your convenience, the case I computed by hand from your own first draw set:
If that arithmetic is right, the mutated shader cannot produce the word
wantdemands, and the draw should have failed — so one of the two runs I did(controls, then draw, same mutant, same session) did something I have not accounted for. If it is wrong, then the mask mutant is equivalent and my
survivor report is noise; I would rather you tell me which than have me guess in public.
I am not claiming your draw half is unfaithful — I am saying I could not explain the result with the evidence I have, and the next reviewer should not
have to rediscover that.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T00:31:33Z.
Correction: the mask survivor is an equivalent mutant, and my hand computation was wrong
I have to withdraw the question in my previous comment. I mutated only the insert side:
The clear mask is still
~(0xffu << s), so bit 8 ofrestis preserved either way, and the inserted value comes fromuint(clamp(F(x), 0.0, 255.0)), which is at most 255 — so& 0x1ffuand& 0xffuselect exactly the same bits. The word is identical:In my previous comment I wrote
rest & ~0x1fffor "mutant" — that is not what the mutant does. The mutant never touches the clear side. So the drawmatching was correct, your draw half is faithful, and the survivor is equivalent: nothing to fix, and no question for you to answer.
Three things I got out of this, for the record rather than for this PR:
text I had just printed in the same comment;
real gap there, the mutation has to widen the clear mask (
~(0x1ffu << s)), which would then be caught by the draw;answered with one more edit.
Sorry for the noise. The rest of the review stands: four of six mutations caught, and the clamp constant is the only thing I would still pin (with a text
assertion, since it is equivalent under the stated precondition).
AI-assisted; the mutant text above is from the run I posted, re-read.
Verified the follow-through before posting the correction
I said the mutation that would be a real gap is widening the clear mask, so I ran it:
Both halves catch it, which is what a faithful pair of controls should do — and it is further evidence that my earlier survivor was equivalent rather
than missed. The clear-side mutation is the one to use if anyone wants a maintained control here.
Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-25T00:39:37Z.
Windows run of the requested draws for #2101, tested at head
2d67fe41930379043235b98b2b6e0799ebf05f27.Environment
devpreset, MSVC; built onlyoffscreen_checkand the tests' dependenciesCommand
Results: 9/9 passed (the
interp_f16family is not in this branch)startup_gfx2hlsl_cvt_pk_u8_controlsstartup_gfx2hlsl_cvt_pk_u8_warpstartup_gfx2hlsl_cvt_pk_u8_hardwarestartup_vertex_fetch_formats_controlsstartup_vertex_fetch_formats_warpstartup_vertex_fetch_formats_hardwarestartup_gfx2hlsl_bit_alu_controlsstartup_gfx2hlsl_bit_alu_warpstartup_gfx2hlsl_bit_alu_hardwareRun by Claude (AI-assisted).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T01:41:06Z.
Review: COMMENTED
Review of head
1afe5a69e748b408b7f38c84b0879abe85cd2d41. No blocking findings.Summary:
v_cvt_pk_u8_f32is lowered only where S0 is +0.0 or an integer in 1..255. Constants are checked at translation. Registers must be proven by an unmodifiedv_cvt_f32_ubyte0..3in straight-line, full-exec code, or the caller must selectpk_u8_s0_contract. The merge expression matches the ISA text. Title and body are neutral and the CI jobs pass.Checked
set_v(rgfor other emitters found none), so discarding the proof there covers all later writes, including loads and multi-register results.v_cvt_f32_ubyte*yields exactly float(0..255), so the proof is sound. It is skipped with modifiers, with branches, or when exec is not the entry mask.pipelinekwargs instartup_gfx2hlsl_lane_alu.pyare optional, so other families are unchanged.windows.ymlentries sit next to the siblingcvt_aluentries.Commands run locally on Linux (output summarised)
python3 -B tests/startup_gfx2hlsl_cvt_pk_u8_check.py-> all ok, rc=0 (translation controls only; no GPU draw was run locally).python3 -B tests/startup_gfx2hlsl_cvt_alu_check.py-> all ok, rc=0 (shared runner is unaffected).python3 tests/docs_links_check.py-> 18 files, 393 links OK.python3 tests/bidi_controls_check.py-> OK.git diff --check origin/main...HEAD-> clean.byte_float_vdiscard inset_v-> the "float multiply is refused" control fails.has_branchesguard -> "no proof in a program with branches" fails.git checkout -- ..P1: none.
P2: none.
Nits
docs/experiments.mdis a long single paragraph. Splitting out the "proven register" rule would make it easier to read.getattr(self, 'byte_float_v', set()).discard(n)runs on everyset_v. Initialising the set in__init__would be simpler. This is not blocking.Not run: Windows WARP/hardware draw (
x2w_pipe.py win2025). This is a re-run of the CI Windows job, which passed on this head. A maintainer who wants a local GPU readback should runstartup_gfx2hlsl_cvt_pk_u8_warp.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T01:07:33Z.
Thanks for the review. Addressed in
1afe5a69.Default path: proven S0 only. In ordinary translation, a register S0 is now accepted only when its value is proven to be +0.0 or an integer in 1..255:
v_cvt_f32_ubyte0..3(e32 or e64, without modifiers) in straight-line code under the entry EXEC, and not written since. The proof is dropped on any later write of the register.Anything else is refused with
v_cvt_pk_u8_f32 source vN is not proven to be +0.0 or an integer in 1..255. That covers a computed value (v_mul_f32after the conversion, for example), a plainv_mov_b32copy,v_cvt_f32_u32, a conversion withclampormul:2, an SGPR, and any of these after a branch or under a partial EXEC.Explicit contract for the fixture.
Pipeline(..., pk_u8_s0_contract=True)states that unproven S0 registers hold only those values. Only then are they accepted, still with the clamp, and the pipeline records the assumption in its notes, so it is written to the manifest. Ordinary translation (load_request,request_refusals) never sets it. The draws select it through the fixture family, so their HLSL is unchanged.Kept: the four selector checks and the dropped-S2 control are unchanged. In the
acceptedlist, the register S0 forms became constants, because they now need the contract. Each of them is covered again in the new contract controls.New controls: an unproven S0 is refused without the contract (three spellings, exact message), and the same words are accepted with it, with the note.
ubyte0..3are accepted without the contract, in e32 and e64. Each refused form above has its own control. Each new control fails on the previous code, on a version where the contract is always on, on a version where the proof survives a later write, and on a version where the proof accepts modifiers.Linux: the check (with
binary /usr/bin/llvm-mc; the words are unchanged), allstartup_gfx2hlsl_*_check.py,startup_translator_check.pyanddocs_links_check.pypass.git diff --checkis clean. The draws were not rerun: the fixture HLSL is the same, only the way the contract is selected changed. A Windows rerun ofstartup_gfx2hlsl_cvt_pk_u8_(controls|warp|hardware)would confirm it.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T01:07:44Z.
Thanks. One concern about the register path.
In a private executable's pixel programs (decode only, aggregate counts):
v_cvt_pk_u8_f32;v_mul_f32right before it, with no rounding instruction in between. That looks like the usualx * 255.0pack to unorm8.So the precondition in the comment ("the program must keep it inside the set") does not hold for these programs: S0 is generally not an integer.
uint(clamp(...))gives a byte one lower for about half the inputs.flt32_to_uint8undefined, as you note.Two options:
v_rndne_f32/v_floor_f32/v_cvt_f32_u32). That keeps the PR exact for what it can prove.pack_unorm_4x8. If the compiler relies on it without an explicit round, that is strong evidence that the hardware rounds.Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T01:15:19Z.
Thanks, @denn0x. Our comments crossed:
1afe5a69(pushed a few seconds before yours) is your option 1, slightly stricter. A register S0 is accepted without the explicit fixture contract only when it comes straight fromv_cvt_f32_ubyte0..3.v_rndne_f32/v_floor_f32/v_cvt_f32_u32prove an integer but not the range: a negative value or one above 255 would still reach the clamp, and the clamp is exactly the undefined part. So the 208v_mul_f32→v_cvt_pk_u8_f32sequences from your scan are refused in ordinary translation.On option 2, the only measurement I found is second-hand and not on RDNA. shadPS4 #5194 (https://github.com/shadps4-emu/shadPS4/pull/5194, merged 2026-10-01) reports a hardware test on PS4 (GCN). Its findings:
S1 & 3.The PR does not describe the test protocol. Nothing else I checked defines the conversion. LLVM has no semantics comment, no constant folding and no pattern for
int_amdgcn_cvt_pk_u8_f32. Mesa ACO only emits it to write exact 8-bit constants on GFX10+, never forpack_unorm_4x8, so it says nothing about rounding.If that holds on RDNA, the truncating
uint(clamp(...))would indeed be one too low for about half of thex * 255.0inputs, as you say. So I'd keep this PR to the proven domain and lower the general form (round half to even, saturate, NaN → 0) in a follow-up, once there is an RDNA readback of the cases above. Anyone with an RDNA 2 adapter who can run a raw gfx10 compute shader would settle it.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T01:40:34Z.
### Independent Windows rerun at
1afe5a69Measured on a physical machine, not CI. The PR head
1afe5a69e748b408b7f38c84b0879abe85cd2d41was merged intoorigin/main4c1b27ddfirst, so the tree under test is merge commitc6583bb0(merge was clean).Command
Result: 3/3 passed, 0 failed, no skips
startup_gfx2hlsl_cvt_pk_u8_controlsstartup_gfx2hlsl_cvt_pk_u8_warpstartup_gfx2hlsl_cvt_pk_u8_hardwareEnvironment, copied from the draw runs themselves:
WARP:
Hardware:
Host: Windows 10 Pro 22H2, build 19045.6466; MSVC x64 Debug (
devpreset); DXC 1.7.2308.16 (Windows SDK 10.0.26100.0).Notes
--no-tests=errormatched exactly the three expected names. Theinterp_f16half of the filter belongs to a different branch and is not registered here, so it selected nothing extra./O2(release) configuration. The workflow skipsbuild-and-test-releaseon pull requests (if: github.event_name != 'pull_request'), so nothing has exercised this change at/O2yet.v_cvt_pk_u8_f32lowering and its drawn pixel output agree with the fixture's expected words on WARP and on the RTX 3060 at this head. It says nothing about any other form or about title startup.Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T01:46:05Z.
Thanks @rasptum for the RTX 3060 / WARP run, and @tedin7 for the review and the mutations.
Nits:
73769831: the proven-register rule now has its own paragraph.getattr(self, 'byte_float_v', ...)as is. Several checks build bareStageobjects (Stage.__new__, or theProbehelpers instartup_gfx2hlsl_*_check.py) that skip both__init__andtranslate(). They then callset_vor the op handlers directly. Initialising the set in__init__ortranslate()and reading it directly broke 14 of those checks withAttributeError. The guard follows the existinguniform_vpattern for the same reason.That commit only changes
docs/experiments.md, so the draws above still apply.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:53:24Z.
Review: COMMENTED
Review of head
73769831d758cf260248bfee694549dbe54480e0(comment only, no approval).Verdict: logic looks sound; one blocker, the branch conflicts with main.
Findings
mergeable: CONFLICTING.git merge-tree --write-tree origin/main HEADreports a content conflict intools/startup/gfx2hlsl.py(windows.yml, CMakeLists.txt and docs/experiments.md auto-merge). Please rebase and re-run the checks below.getattr(self, 'byte_float_v', set()).discard(n)inset_vallocates a throwaway set on every register write when the attribute is absent. Initialisingbyte_float_vin the Stage constructor would remove thegetattr/setdefaultindirection in both places.What I checked
tools/compute_store_aot.pyaccepts for the same opcode, and the PR text states the undefinedflt32_to_uint8behaviour honestly.v_cvt_f32_ubyte0..3with no modifier, with straight-line code and full exec, and with no write since. Every write goes throughset_v, which clears the proof, including the fma_mix path. Otherwise it is refused unless the fixture-onlypk_u8_s0_contractis selected, and that choice is recorded in the pipeline notes.0xff << 8*S1[1:0], merge into S2.win2025), because the PR's own Windows CI job passed and the draw test is in that job.Commands run locally
python3 tests/startup_gfx2hlsl_cvt_pk_u8_check.py->v_cvt_pk_u8_f32: 8 draw sets: ok,mutation changes draw set 0: okpython3 tests/startup_gfx2hlsl_lane_alu.py->accepted forms translate: ok,refused forms stay refused: ok,Self-test passed.python3 tests/docs_links_check.py->Checked 18 Markdown files and 393 links.python3 tests/bidi_controls_check.py->no bidirectional controls.git diff --check origin/main...HEAD-> cleansrc[1] not in byte_float_vreplaced byFalse). The tests failed withunproven S0 refused without the contract, so the mutation was killed.set_v. The tests failed witha float multiply is refused without the contract, so the mutation was killed.git checkout -- ..AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:09:03Z.
Review: COMMENTED
Re-review of head
2487e8f8888c5f78acf8c06c183856b32aa85bf9(comment only, no approval).Verdict: the earlier P1 (merge conflict with main) is resolved. No blocking findings.
Earlier P1 check
mergeable: MERGEABLE.git merge-tree --write-tree origin/main HEADreturns a clean tree, with no conflict intools/startup/gfx2hlsl.py.CI on this head: Linux checks, gfx1013 fixtures and Windows build pass. The /O2 job and the coverage chart job were skipped.
Commands run locally on Linux (output summarised)
python3 -B tests/startup_gfx2hlsl_cvt_pk_u8_check.py-> all ok, rc=0python3 -B tests/startup_gfx2hlsl_cvt_alu_check.py-> all ok, rc=0python3 tests/docs_links_check.py-> 18 files, 405 links OKpython3 tests/bidi_controls_check.py-> OKgit diff --check origin/main...HEAD-> cleantools/startup/gfx2hlsl.py. The new check fails. The change was reverted withgit checkout -- ..P1: none.
P2: none.
Nits (unchanged, not blocking)
getattr(self, 'byte_float_v', set()).discard(n)inset_vallocates a set on every write. Initialisingbyte_float_vin the constructor would remove thegetattr/setdefaultindirection.Not run: a Windows WARP/hardware draw. The CI Windows job passed on this head. A maintainer who wants a local GPU readback should run
startup_gfx2hlsl_cvt_pk_u8_warp.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T04:04:55Z.
Merged
main(4b9490ac) into the branch; new head2487e8f8, mergeable again. One conflict intools/startup/gfx2hlsl.py:Pipeline.__init__now takes bothps_attr_map(frommain) andpk_u8_s0_contract. The three PR commits are unchanged.Re-run locally on the new head:
startup_gfx2hlsl_cvt_pk_u8_check.py,startup_gfx2hlsl_lane_alu.py,startup_translator_check.py,docs_links_check.py,bidi_controls_check.py, plus all 41tests/startup_gfx2hlsl_*_check.py(including the onesmainjust added): all exit 0.git diff --check origin/main...HEADis clean.On the
byte_float_vnit: kept thegetattr, since the bareStageobjects in the checks skip__init__(see my earlier comment).@tedin7, since you offered: could you run the Windows draws on
2487e8f8when your server is free?The
/O2(release) configuration is still untested for this change.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:20:41Z.
Review: COMMENTED
Re-review of head
77b36dddbf6b69b67eaba4816311fe9ec840fa00(a merge of main only; the PR's own diff is unchanged in substance since the previous reviewed head).Scope:
v_cvt_pk_u8_f32lowering intools/startup/gfx2hlsl.py, newtests/startup_gfx2hlsl_cvt_pk_u8_check.py,lane_alufixture hook (pipelinekwargs), CMake and workflow wiring.Commands executed locally in a clean worktree of this head:
git diff --stat origin/main...HEAD: 6 files, +246/-6.python3 -B tests/startup_gfx2hlsl_cvt_pk_u8_check.py: four lanes translated ok; 8 draw sets ok; mutation changes draw set 0 ok.python3 -B tests/startup_gfx2hlsl_lane_alu.py: accepted forms translate ok; refused forms stay refused ok.python3 tests/docs_links_check.py: 18 files, 407 links, ok.python3 tests/bidi_controls_check.py: 1489 files, no bidi controls.git diff --check origin/main...HEAD: clean.if False). The refused-forms check fails, so it is killed.& 3uto& 7u. The translated-text check fails, so it is killed.git checkout -- ..gh pr checks: Linux checks, gfx1013 fixtures and Windows build/test are green. The /O2 job and the chart publish were skipped. The PR is mergeable.Findings:
byte_float_vis read throughgetattr(self, ..., ())and created through__dict__.setdefault. A normal attribute set in__init__would be simpler and would not hide a typo. Optional.set_vdiscards the proof, but any future path that writesself.v[...]withoutset_vwould keep a stale proof. Today I found no such path. A short comment at the proof site would help.Semantics: the formula
D = (S2 & ~(0xff << 8*S1[1:0])) | ((cvt(S0) & 0xff) << 8*S1[1:0])matches the ISA text. Leaving the undefinedflt32_to_uint8cases out by requiring S0 to be +0.0 or an integer in 1..255 is conservative, and the proof/contract split is clear. Titles and text are neutral and clean-room.Verdict: no blocking issues from this review.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:59:28Z.
Review: COMMENTED
Re-review of head
e556be5e11(changes since77b36ddd:byte_float_vbecomes a class default,set_vand the proof/lookup sites no longer usegetattr/__dict__.setdefault).Verdict: no P1, no P2.
What I checked
git diff --stat origin/main...HEAD: 6 files, gfx2hlsl.py + one new check + lane_alu hook + CMake/CI/docs. Title is neutral, PR is MERGEABLE.set_v(singleemit('v%d = ...')at gfx2hlsl.py:630), andset_vis where the proof is dropped. The new comment at the proof site states this contract. Good.()is falsy, soset_vskips the discard until the first proof creates a per-instanceset. No shared mutable state between stages.pk_u8_s0_contract, and that choice is recorded inpipe.notes.D = (S2 & ~(0xff << 8*S1[1:0])) | ((cvt(S0) & 0xff) << 8*S1[1:0]).Commands run locally on the head
python3 -B tests/startup_gfx2hlsl_cvt_pk_u8_check.py: all steps ok (four lanes translated, 8 draw sets, mutation changes draw set 0, accepted/refused forms).python3 -B tests/startup_gfx2hlsl_lane_alu.py: Self-test passed.python3 tests/docs_links_check.py: 18 files, 407 links ok.python3 tests/bidi_controls_check.py: no bidirectional controls.git diff --check origin/main...HEAD: clean.Mutations (each reverted with
git checkout -- .)set_vno longer discards the proof: killed (AssertionError: a float multiply is refused without the contract).& 3uchanged to& 1u: killed (translated text reads 42fe0000 12345676 01fe7f80).Windows: I did not run the Win2025 pipeline. The WARP/hardware draw tests are registered in CMake and the Windows CI job passed on this head.
Nits (non-blocking)
byte_float_vis typed as a tuple at class level but becomes aseton first use. A one-word comment would make the switch explicit.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T05:16:38Z.
Merged
mainagain (13 new commits, conflicts inset_v, thev_cvt_f32_*path with the newlow16_onlyoperands, andPipeline.__init__withsrv_formats; both sides kept). New head77b36ddd, mergeable; alltests/startup_gfx2hlsl_*_check.pyandstartup_translator_check.pypass locally. @tedin7, please use77b36dddrather than2487e8f8for the Windows draws.Imported from R0Y00/Xbox2Windows. Originally posted by Ybucaille on 2026-11-25T05:54:56Z.
Thanks @tedin7. Both nits done in
e556be5e:byte_float_vnow has an immutable class default()replaced by a set on the first proof (same pattern aslow16_only_v), so thegetattr/__dict__.setdefaultindirection is gone and probes without__init__still work. The proof site now says that every VGPR write must go throughset_v, which drops the proof. Mutation tried: skipping the drop inset_vmakesstartup_gfx2hlsl_cvt_pk_u8_check.pyfail. Allstartup_gfx2hlsl_*checks pass locally.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T06:05:52Z.
Review: APPROVED
The original S0 finding is resolved. Ordinary translation refuses an unproven value, and an explicitly selected profile records its input contract. All four byte selectors and the lost-S2 mutation verified independently on WARP and RTX 4060 Laptop.
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T06:05:47Z.
Ran head
e556be5eon three adapters. All pass. Windows 11 build 26100, debug layer unavailable, FXC and DXC from SDK 10.0.26100.0.startup_gfx2hlsl_cvt_pk_u8_controlsstartup_gfx2hlsl_cvt_pk_u8_warpstartup_gfx2hlsl_cvt_pk_u8_hardware(XBOX2WINDOWS_ADAPTER=Quadro)startup_gfx2hlsl_cvt_pk_u8_hardware(XBOX2WINDOWS_ADAPTER=Intel)Every run printed the same 5 ok lines, and the FXC and DXC mutations each failed as expected, for example
fxc v_cvt_pk_u8_f32 mutation: fails as expected, reads 00000000,00000100,007f0000,ff000000.AI-assisted.