Repository navigation
startup: add a compute stage to gfx2hlsl with the offen buffer store - #2182
Conversation
ComputePipeline translates one gfx1013 compute program with the root and resource model of the graphics stages. COMPUTE_PGM_RSRC2 and the thread group size come from the caller and follow compute_store_aot's entry layout (R0Y00#1608): root parameters from s4, one SGPR per enabled group-ID axis after the user SGPRs, and v0-v2 as SV_GroupThreadID. TG_SIZE_EN stays refused, and a numeric read of a user SGPR the root does not place is refused. The output is a cs HLSL main with numthreads and a version 2 manifest (stage cs, group, uav <slot> table <param> <offset>). The one store lowered is buffer_store_dword[x2-4] in the offen form through a fixed root-table descriptor, to a RWByteAddressBuffer. The fixture translates two source-built programs (all axes; X and Z only), compiles them with DXC and dispatches them on a plain D3D12 device, comparing all 320 words. Swapped group axes and a dropped store must mismatch. Refs R0Y00#1412 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- Store descriptor: all four words must still be the words the s_load returned. A moved, overwritten or modified word refuses the store. A modification is now recorded for the descriptor the word belongs to (load offset + 4 * (dword & ~3)), not for the load's first descriptor. Translating every locally cached graphics request gave identical output. - Compute: a scalar instruction inside a block s_cbranch_execz skips is refused. The wave runs that block when any lane is active. - Compute: an implicit-LOD image_sample is refused instead of sampling level 0. - An immediate store offset that is not a multiple of 4 is refused. The run-time part is rounded down as in R0Y00#2059. - Graphics stages keep the unknown-op refusal text for buffer stores. - Root parameters from s4 are documented as an inference, not as R0Y00#1608. - Fixture: case C stores x4 and, under a compare-set exec, x3. New controls drop case B's immediate offset and case C's exec predicate. Refs R0Y00#1412 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tedin7
left a comment
There was a problem hiding this comment.
Review of head 0236bbc (comment only, no approval).
Scope read: tools/startup/gfx2hlsl.py (cs entry, execz guard, buffer_store_dword*), tests/startup_gfx2hlsl_compute_check.py, CMakeLists.txt, windows.yml, AGENTS.md, docs/experiments.md.
Commands executed locally (Linux):
python3 -B tests/startup_gfx2hlsl_compute_check.py-> "compute entry, numthreads, manifest, offen store forms and the store, descriptor, execz and sample refusals pass"python3 tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-15-> not runnable here (llvm-mc-15 not installed); covered by the Linux CI job, which is green.python3 tests/docs_links_check.py-> 402 links OK;python3 tests/bidi_controls_check.py-> OK;git diff --check origin/main...HEAD-> clean.- Mutation: changed the store alignment mask
0xfffffffcuto0xfffffff8uin op_buffer_store_dword. The Linux controls fail (exact-line assertion on the emitteda = (...) & 0xfffffffcu;). Reverted withgit checkout -- ..
Windows (Win2025 node, x2w_pipe.py win2025 2182 --scope direct --regex startup_gfx2hlsl_compute --force):
- Debug phase: 11/11 ctest passed (compute_controls, compute_warp, compute_hardware, and the 4 controls swapped-axes / dropped-store / b-offset / c-unpredicated on both adapters). The real D3D12 readback against the CPU reference is therefore exercised and the 4 controls are rejected as intended.
- Release phase did not complete: the first attempt and the retry both died in sccache ("existing connection was forcibly closed") while compiling d3d12_xs_device.cpp. That is a node cache failure, not a PR failure; I do not count it as evidence either way. GitHub "Build and test on Windows" was still pending when I looked.
Findings:
- P1: none. P2: none.
- nit 1 (gfx2hlsl.py, setup_compute_entry): user SGPR base s4 is an inference, and it is documented as one in the comment and in docs/experiments.md. Good; keep the refusal of reads of s0-s3 until real evidence exists.
- nit 2 (gfx2hlsl.py, op_buffer_store_dword): rounding the run-time address down to 4 bytes and ignoring num_records/stride are stated assumptions, not measured. The comment says so. Consider one control that stores past the range so the future runtime change cannot go unnoticed.
- nit 3 (tests): on Linux the mutation is killed by an exact HLSL line check, which is brittle against harmless HLSL formatting changes. The behavioural kill happens only in the Windows WARP/hardware tests (controls cover axes, dropped store, b-offset, unpredicated C). That is fine, but note the Linux job alone does not prove the arithmetic.
- windows.yml: the new check is added both to the binary matrix (with llvm-mc-15) and to the direct list, next to sibling gfx2hlsl checks. Consistent. AGENTS.md: one line added in the same order as the siblings. Consistent. CMake: controls registered per adapter with SKIP_RETURN_CODE 77 and PASS_REGULAR_EXPRESSION, matching the mad/swap siblings.
- Clean-room: no external code or names; title is neutral; PR is mergeable.
AI-assisted; commands listed were executed locally.
A store whose immediate offset puts it past the descriptor's range still translates to a plain RWByteAddressBuffer Store with no range check, and the manifest carries no size: num_records and stride are not read, and dropping such a store is left to a runtime that sizes the view. The control pins that stated behaviour, so changing the policy has to update it (review nit on R0Y00#2182). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks for the review. Added 94b042b for nit 2: a pure-Python control that pins today's translation of a store past the descriptor's range ( AI-assisted (Claude Code). |
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 94b042bac51961db9be4fd5218b3ab0eb92d9c01 (previous review was on 0236bbcb). Scope: compute stage in tools/startup/gfx2hlsl.py, new tests/startup_gfx2hlsl_compute_check.py, CMake/CI/docs wiring.
Status: mergeable, CI green on this head (Linux checks, gfx1013 fixtures, Windows build and test; /O2 and chart jobs skipped). Title and body are neutral. No external or clean-room concerns seen in the diff.
Commands executed locally in a worktree of the head:
git diff --stat origin/main...HEAD: 6 files, +652/-4python3 tests/startup_gfx2hlsl_compute_check.py: pass ("Self-test passed.")python3 tests/docs_links_check.py: pass (18 files, 402 links)python3 tests/bidi_controls_check.py: pass (1465 files)git diff --check origin/main...HEAD: clean
Mutations (each reverted with git checkout -- .):
- Disabled the
s_cbranch_execzskipped-block guard intranslate(): killed (test fails: expected refusal namings_add_u32 inside a block s_cbranch_execz skips). - Dropped the
& 0xfffffffcudword rounding inop_buffer_store_dword: killed (test pins the emitteda = (v4 + 0) & 0xfffffffcu;). - Removed the
desc_key(first) in self.pipe.modifiedclause in the store's descriptor check: survived.
Findings:
- P1: none.
- P2: none.
- nit (
tools/startup/gfx2hlsl.py,op_buffer_store_dword, thedesc_key(first) in self.pipe.modifiedclause): mutation 3 survives. The per-wordself.symcomparison already catches a modified word because the writer now tags it('modified',), so the clause looks redundant. Either add a case where onlypipe.modifiedcarries the mark, or drop the clause. - nit (
op_buffer_store_dword): the out-of-range store is deliberately unguarded and the comment and the new pinning test say so. It stays an assumption until a runtime sizes the UAV view. Fine to keep as documented. - nit (
setup_entry): the compute root start at s4 is an inference. The code comment anddocs/experiments.mdsay so honestly, and unplaced user SGPRs are refused on read. Good.
Not run: Win2025 WARP. The compute store is not yet covered by a GPU readback in this PR, which is acceptable for a translator-only slice, but a WARP readback of the offen store versus a CPU reference should come before the follow-up that binds the UAV.
Verdict: no blocking issues on this head; the earlier review points look addressed.
AI-assisted; commands listed were executed locally.
R0Y00
left a comment
There was a problem hiding this comment.
The combined tree with current main (including #2139) passed the compute buffer-store comparison and all four mutations on both WARP and RTX 4060 Laptop. I found one scope leak in that combination: a source-built CS Stage with a table SRV and image_load v4, v[0:1], s[16:23] dim:SQ_RSRC_IMG_2D dmask:0x3 d16 emits pack16_d16(..., ud0) and udsrc 0 d16unorm16 0. ComputePipeline.manifest does not emit the d16srv bound-view requirement, and the CS path has no equivalent per-view validation. Please update against #2139 and explicitly refuse D16 loads in CS for this buffer-store slice. Add that synthetic case as a refusal control. Supporting D16 compute textures can follow when the compute consumer validates the effective SRV format.
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 0a523d0 (comment only, no approval). Earlier reviews covered 0236bbc and 94b042b.
Scope: git diff --stat origin/main...HEAD is 6 files (gfx2hlsl.py, the compute check, CMakeLists.txt, windows.yml, AGENTS.md, docs/experiments.md). The new part since the last review is the "refuse unvalidated compute D16 loads" change in image() plus the D16 SRV format sets.
Commands executed locally (Linux):
python3 -B tests/startup_gfx2hlsl_compute_check.py-> passpython3 -B tests/startup_image_sample_l_check.py-> FAIL:AttributeError: 'Stage' object has no attribute 'kind'(tools/startup/gfx2hlsl.py:1803, from tests/startup_image_sample_l_check.py:205bare.image(...))- all
tests/startup_gfx2hlsl_*_check.pyandtests/startup_*gfx*check.py-> pass (the failure above is outside that glob) python3 tests/docs_links_check.py-> 407 links OK;python3 tests/bidi_controls_check.py-> OK;git diff --check origin/main...HEAD-> clean- Mutation: replaced
self.kind == 'cs' and 'd16' in modswithFalse and 'd16' in mods. The compute check fails ("accepted, expected a refusal naming 'compute d16 image load requires validated SRV formats'"), so the new refusal is guarded. Reverted withgit checkout -- .. - CI: "Run platform-independent Python checks on Linux" is red on this head. The log shows the same traceback, in tests/startup_image_sample_l_check.py. The Windows jobs were still pending when I looked.
Findings:
- P1: none.
- P2 (tools/startup/gfx2hlsl.py:1803):
image()now readsself.kindunconditionally.Stageinstances created withoutkind(the bare Stage in tests/startup_image_sample_l_check.py:205 and its address-count control) raise AttributeError before any other check, so an existing test fails and the Linux CI job is red. Fix: set a defaultkindonStage(orgetattr(self, 'kind', None)), or have that test setbare.kind = 'ps'like startup_gfx2hlsl_refusals_check.py:37 does. A class-level default is safer, since other callers could build a Stage the same way. - nit (tests): the D16 refusal is covered for the unvalidated case. Add one control that a validated SRV format in D16_EXACT_SRV_FORMATS still lowers on cs, so the allowlist cannot be emptied unnoticed.
- Earlier nits (user SGPR base s4 is an inference, store alignment/num_records assumptions, the Linux kill is an exact-line check) still stand and are documented in the code and docs.
Windows: I did not run x2w_pipe.py win2025 on this head. The Linux job is already red, and the earlier Win2025 debug result (11/11) was for 0236bbc. It needs a rerun after the P2 fix.
Verdict: not ready until the P2 is fixed and CI is green.
AI-assisted; commands listed were executed locally.
R0Y00
left a comment
There was a problem hiding this comment.
Re-reviewed 0a523d0. The integration explicitly refuses a D16 load in compute until that consumer validates the bound SRV, and the new control checks that refusal. Compute buffer-store controls, graphics D16 tests, and the offline producer test pass. The combined branch's three 320-word GPU comparisons and four mutations ran on WARP and RTX 4060 Laptop before this narrow guard. This lands the standalone compute translator only. Runtime binding and the real application Dispatch remain separate.
… D16 guard The compute D16 guard added in 0a523d0 reads self.kind at the top of Stage.image. Checks that build a bare Stage to reach the operand-only refusals (tests/startup_image_sample_l_check.py and others) have no kind, so the Linux Python job failed with AttributeError. Read kind with a default; the guard is unchanged for a compute stage. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The Linux Python job failed on 0a523d0: Pushed a one-line follow-up on top of your commit: the guard reads AI-assisted (Claude Code). |
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 5633dcd (PR #2182).
Delta since my last review (0a523d0): one line, tools/startup/gfx2hlsl.py:1803, self.kind == 'cs' became getattr(self, 'kind', None) == 'cs'. This addresses the earlier P2 (bare Stage without kind raised AttributeError before the image refusals).
Commands executed locally (Linux):
python3 -B tests/startup_image_sample_l_check.py-> pass (was FAIL on 0a523d0)python3 -B tests/startup_gfx2hlsl_compute_check.py-> pass- all
tests/startup_*gfx*check.pyandtests/startup_image*check.py-> pass, no failures python3 tests/docs_links_check.py-> 18 files, 407 links OKpython3 tests/bidi_controls_check.py-> OKgit diff --check origin/main...HEAD-> clean- Mutation: replaced the guard with
False and 'd16' in mods. The compute check fails ("accepted, expected a refusal naming 'compute d16 image load requires validated SRV formats'"), so the refusal is guarded. Reverted withgit checkout -- .. - CI on this head: "Run platform-independent Python checks on Linux" pass, "Assemble and translate gfx1013 fixtures" pass, "Build and test on Windows" pass. The /O2 job and the chart job are skipped. PR is mergeable, title is neutral.
Findings:
- P1: none.
- P2: none. The previous P2 is fixed.
- nit (tests, carried over): add one control that a format in D16_EXACT_SRV_FORMATS still lowers on cs, so the allowlist cannot be emptied unnoticed.
- Earlier nits (user SGPR base s4 is an inference, store alignment/num_records assumptions, the Linux kill is an exact-line check) still stand and are documented in the code and docs.
Windows: I did not run x2w_pipe.py win2025. The change since the last Win2025 run is a one-line Python default with no HLSL output change, and the Windows CI job is green. The maintainer's Draft -> Ready gate still needs its own WARP run on the final head.
Verdict: no blocking findings from this review.
AI-assisted; commands listed were executed locally.
ComputePipeline (R0Y00#2182) maps buffer descriptors to u indices in self.uavs and declares them itself; the inherited common() and manifest() read stored_images() as pixel-stage image entries, which a compute program cannot have. startup_gfx2hlsl_compute_check.py fails without this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* startup: lower pixel-stage image_store to a typed UAV store gfx2hlsl refused image_store in every stage (#1996 item F). In a pixel stage, image_store with dim:SQ_RSRC_IMG_2D and dmask:0xf now becomes w<n>[uint2(x, y)] = asfloat(uint4(data)) on a RWTexture2D<float4> at its own u register, under the lane's exec bit, and the manifest becomes version 2 with "uav <index> tex2d table <table> <offset>". Semantics: MIMG opcode 0x08 (LLVM AMDGPU MIMGInstructions.td, IMAGE_STORE defined through MIMG_Store): VDATA is the source, VADDR the integer texel address (x, y for dim 2D), SRSRC the image descriptor, and the DMASK channels are written in order from consecutive VDATA registers. Mesa ACO (visit_image_store) emits the same form with DMASK from the write mask. A typed UAV store writes every channel, so only DMASK 0xf is exact; a partial mask, other dimensions, d16, a16, tfe, lwe, r128, unorm, image_store_mip, a store outside a pixel stage and a load and store of the same image are refused by name. glc, slc and dlc are accepted. The translated graphics path does not bind UAVs yet: d3d12_draw.inl logs and does not use a translation whose manifest has a uav line, instead of rejecting it as an invalid sampler-heap line. startup_pixel_image_store_check.py decodes the hand-assembled program with disasm_rdna2, checks the translation, the refusals, and that the program is refused again with the lowering removed. The draw stores four values at texel (1, 2) of a 4x4 image through offscreen_check --startup-image-store, reads all 16 texels back, and checks that deleting the store or exchanging x and y is detected. Refs #1996 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: check the image_store dmask guard itself The two encoded partial-mask controls only asserted that image_store was refused. The decoder sizes VDATA from the mask (v[4:6], v4), so with the dmask guard disabled the data-register check still refused them and the controls passed. Each now asserts the dmask reason, and a new control calls the handler with v[4:7] and dmask 0x7, which only the mask guard can refuse; another passes dmask 0xf with three data registers and asserts the data reason. With the guard replaced by `if False:` the check fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: give Pipeline.uavs a class default instead of a __dict__ fallback Pipelines that tests assemble without __init__ store to no image. A class attribute of None now says so; the first store creates the instance's own map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: rewrap the pixel-stage image store bullet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: refuse malformed image_store dmask text by name int(masks[0], 0) raised ValueError on mask text that is not an integer; it is now an Unsupported refusal ("not an integer"), with a control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: check the image_store exec guard Two variants put v_cmpx_eq_u32 before the store so exec is not known at translation time. The controls assert that the emitted store is guarded by the lane's exec bit, and the draw mode reads the image back: with the lane on the texel is written, with every lane off it keeps its starting value, and the exec-off shader with the guard removed must write it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: keep compute buffer UAVs out of the pixel-stage image list ComputePipeline (#2182) maps buffer descriptors to u indices in self.uavs and declares them itself; the inherited common() and manifest() read stored_images() as pixel-stage image entries, which a compute program cannot have. startup_gfx2hlsl_compute_check.py fails without this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: name the texel_mismatch line in the image store controls The controls printed the first stderr line as the reason, which on a machine with several adapters is an adapter notice. They now print the texel_mismatch report they already assert on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: check that a compute program lists no pixel-stage image stores The compute stage's buffer stores live in self.uavs (descriptor key -> u index), which the shared common() and manifest() must not read as #2155's image stores. The control asserts stored_images() is empty before any output is built, then no RWTexture2D declaration, the `x2w-manifest 2` / `stage cs` header and the single kind-less uav line. With ComputePipeline.stored_images removed it fails at that assertion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: rasptum <348594691+rasptum@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Change
This adds a compute stage to the startup translator,
tools/startup/gfx2hlsl.py. It lowers one computestore form. Refs #1412.
What it adds
gfx2hlsl.ComputePipeline(cs_code, root_blob, rsrc2, group)translates one gfx1013 compute program. Ituses the same root, resource and entry-constant model as the graphics stages.
Entry registers:
COMPUTE_PGM_RSRC2and the thread group size, which are pipeline register state.COMPUTE_PGM_RSRC2is decoded with the mergedcompute_store_aot.entry_registers(shader: place compute entry registers from COMPUTE_PGM_RSRC2 #1608). The userSGPRs come first, then one SGPR per enabled group-ID axis with no gap for an omitted axis
(
SV_GroupID). v0-v2 holdSV_GroupThreadIDup toTIDIG_COMP_CNT.gfx2hlslnow importscompute_store_aot(and through itpixel_aot) lazily.TG_SIZE_ENstays refused, as asked on compute: entry layout from COMPUTE_PGM_RSRC2 (user SGPRs, group id, TG_SIZE, thread-id VGPRs) #1544.way the graphics stages' s8 is. shader: place compute entry registers from COMPUTE_PGM_RSRC2 #1608 defines no root placement. The only evidence in the repository is
a local compute-record scan whose table bindings used s4 or s5 (
docs/experiments.md).Output:
csHLSL main with[numthreads].stage cs,group X Y Z,ud/udsrc/srvlines in the existing format,and
uav <slot> table <param> <byte offset>.Store lowering:
buffer_store_dword/x2/x3/x4in theoffenform. The address is aper-lane byte VGPR plus the scalar offset and the immediate. The descriptor must sit at a fixed
root-table offset, and the target is a
RWByteAddressBuffer.s_loadreturned.offandidxenforms, andglc/slc/dlc;New compute-only refusals:
v_readlane/v_readfirstlane/v_writelane) inside a block thats_cbranch_execzskips. The wave runs such a block when any lane is active. The one-lane model wouldskip it for an inactive lane and lose the scalar result.
image_samplewith implicit LOD. A compute lane has no derivatives. The_l/_lzforms are kept.Shared change (affects graphics too):
s_and_b32 s18, s18, …) was recorded under the key of theload's first descriptor. It is now recorded under the descriptor the word belongs to: load offset
plus
4 * (dword & ~3).idxenloads consult that set.123 of which translate. The HLSL and manifest hashes and the refusal texts were identical, so no
graphics output moved.
buffer_store_dwordx3), sorefusal census buckets do not move.
Not in this change
and slot 14 still drops the dispatch.
translated with no refusal; their weight is 2,926 direct and indirect dispatches. This is a local
observation and the frame's data is not public.
buffer_load_format_*(startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138 and the help wanted: GPU translation, part 4 (compute shaders) #2022 item A split),resource-heap
s_loadwith a register offset (startup-runtime: dynamically indexed sampler and resource heap loads #1143),s_mulk_i32,v_readfirstlaneuniformity,buffer_store_format_d16_x, LDS writes,src_scc(startup: read src_scc as the SCC bit #1821) andimage_store.buffer_store_format_d16_x, adescriptor whose stride field was cleared (
s_andof dword 1 with0xc000ffff),image_storeandthe
offform.cache. It is on a local companion branch,
compute/slot67-requests.Open design question: which tool is the runtime compute translator?
On #1412 the maintainer described the first slot-67 fixture: "A useful first slot 67 fixture would bind
explicit group dimensions, a read buffer and a writable resource, then verify nonzero GPU output plus a
dropped-dispatch or swapped-binding control." This change follows that description.
The compute lowerings merged so far live in
compute_store_aot, and #2022 item A is being added there.compute_store_aottakes its bindings from the caller (table_reg,descriptor_offset, …), and #1994'srecords do the same. gfx2hlsl derives them from the root signature and already feeds the runtime shader
cache, which is why the stage is added here and reuses
compute_store_aotonly for theCOMPUTE_PGM_RSRC2decode.If the runtime compute translator should instead be
compute_store_aot, made to serve requests, thisstage should move there; please say so.
Overlapping work
shader: lower buffer_store_dwordx3 in gfx2hlsl (Part of #1723) #2059 (tedin7) adds
op_buffer_store_dword*to the same handler for vertex-stageoffstores.This change uses the same shapes:
uavsregistry anduav();RWByteAddressBuffer u<n> : register(u<n>)declaration and theuav <slot> table <param> <offset>line;
down.
Whichever lands second has to merge the two into one handler, with the address form chosen per stage.
Expect a textual conflict there.
shader: add offline native compute translation and cache #1994 (ArnabSaga): offline translation of fixture programs through
compute_store_aot, with aseparate cache protocol. No code overlap.
startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor #2138 (tedin7):
buffer_load_format_*in gfx2hlsl, the largest first refusal above. No code overlap.Known gaps shared with the graphics stages, not changed here
refused only for compute in this change.
s_cbranch_vccz/vccnzands_cbranch_execnzloops are also evaluated per lane while the waveevaluates them per wave. Scalar state updated inside a loop that lanes leave at different times can
differ.
idxenload still checks only the first register of its descriptor operand. An overwritten laterword is not seen there.
AI-assisted (Claude Code).
Verification
Commit
0236bbcb(on65f8ef9d). Windows 11 build 26300, MSVC Release,offscreen_checkbuilt in theworktree, DXC 10.0.26100.0, debug layer enabled.
startup_gfx2hlsl_compute_{warp,hardware}: cases A (3x2x2 groups), B (4x1x3), C (1x5x1)swapped-axes(case A)dropped-store(case A)b-offset(case B without its immediate offset)c-unpredicated(case C without the exec predicate)ctest: 11/11 passed, 0 skipped. The hardware variants return 77 without a GPU; that path was not
exercised here because a GPU was present.
Debug layer: 0 errors and 0 warnings in every run.
Each control is pinned in CMake by
PASS_REGULAR_EXPRESSION "control <name>: rejected at word=[0-9]+ ".Pure-Python controls pass. Each of these reviewed inputs was accepted before and is now refused:
s_mov_b32 s18, 0);s_or_b32 s17, s17, 0x40000;s_and_b32 s18, s18, 0xffff;s_mov_b32 s18, 4between two stores;s_and_saveexec_b32form;
image_sample;offset:6.The modification is recorded under byte 16 of the x8 load, not byte 0. An
image_sample_lzstilltranslates. The graphics refusal text is unchanged.
The
binarymode reassembles the three programs and every spliced control instruction with llvm-mc 15.52 other pure-Python checks pass: all
tests/startup_gfx2hlsl_*_check.pyandstartup_translator,plus
compute_entry_layout,startup_flat_param,startup_buffer_address,startup_smem_address,startup_stream_fetch,startup_sampler_heap,startup_inline_sampler,docs_linksandbidi_controls.git diff --checkis clean.Not run: the full ctest suite, CI, FXC (the runtime cache's compiler) on compute output.
Evidence and follow-up
tests/startup_gfx2hlsl_compute_check.py, withtheir llvm-mc source and recorded words. They contain no retail bytes. MIT.
an exec mask set from a compare.
root signature (root SRV t0, root UAV u0, 16 root constants at b0). These match the translation's
r0,u0and entry cbuffer by register. The manifest'ssrv/uavtable lines and the descriptor fetchfrom the table are not exercised on the GPU; they are checked only as text.
compute/slot67-requestspublishes slot-67 requests (.cscode,.root, and a 28-byte state block.sa).A local run produced 2,689 of them.
.sadword 3 (low and high 16 bits), Z in dword 4 (low 16 bits);COMPUTE_PGM_RSRC2in dword 6.TG_SIZE_EN, which this stage refuses.load_requestfor.csintoComputePipelineis the piece after both PRs land.(4 + parameter SGPRs + heap pointers). That lies inside the observed user SGPR range of 4 to 14, so
the refusal "root needs more SGPRs than
USER_SGPR" is not expected to fire for them.USER_SGPRwith its own root.buffer_store_format_*andimage_storein gfx2hlsl.ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute_' -V. The new sectionis "Compute stage in the startup translator" in
docs/experiments.md.Checklist
🤖 Generated with Claude Code