Repository navigation
shader: lower s_quadmask_b32 in gfx2hlsl (#1723) - #13
Open
SimSalabimse wants to merge 77 commits into
Open
SimSalabimse wants to merge 77 commits into
SimSalabimse wants to merge 77 commits into
Conversation
…ts with CLI suite (R0Y00#2608) Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…0#2613) X2W_D3D12_VIEW_CENSUS=1 counts new distinct view records by device slot and logs the record vector capacity and hash bucket count before an insertion that is expected to grow either. Record identity, ids and descriptor binding do not change. Refs R0Y00#1199 Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…Y00#2475) * startup: lower v_pack_b32_f16 with op_sel and neg/abs in gfx2hlsl D[15:0] = S0.f16, D[31:16] = S1.f16 (AMD RDNA 2 ISA, VOP3 V_PACK_B32_F16). op_sel[i] selects the high half of source i (LLVM 15: VOP3_OPSEL); neg and abs act on bit 15 of the selected half, abs first. The halves are copied as bits, as pixel_aot lowers the same instruction; no binary16 denormal flush or NaN quieting is modelled (assumed). Register sources only: an inline float constant on a binary16 operand is a binary16 value. A destination op_sel bit and clamp are refused. Test: tests/startup_gfx2hlsl_pack_b32_f16_check.py evaluates the emitted expression for every op_sel x abs x neg combination over sample register pairs against a bit reference (2304 cases), plus an SGPR source. Negative controls: swapped halves and neg-before-abs are caught by the reference; without the handler the instruction is refused, as on main. * gfx2hlsl: explain the low/high half reads and the strict op_sel spelling in v_pack_b32_f16 (comments only) * tests: verify packed binary16 output words on D3D12 --------- Co-authored-by: Royoo <3230853833@qq.com> Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…ght with CLI suite (R0Y00#2609) Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…ta with CLI suite (R0Y00#2616)
…32 (R0Y00#2623) A lane-mask register (a compare result, vcc_lo, exec_lo, a saved EXEC copy) holds only the current lane's bit in the one-lane model, while RDNA 2 reads the whole mask word when the register is a data operand. v_cndmask_b32 (both data operands) and v_mov_b32 (plain, e64 and SDWA DWORD) took such a register through u()/u_src and emitted the lane bit. They now refuse it, after stripping the source modifiers; the lane select of v_cndmask is unchanged. Tests that moved a mask with v_mov_b32 first now expect the new refusal, or read the mask as a lane select instead so they still reach the refusal they test. The SDWA check that accepted a whole-mask move now expects a refusal. AI-assisted.
…R0Y00#2615) * tests: run compute store references on a shared renderer device * tests: compare the descriptor fixture using one device for its reference cases * tests: use one root signature and compute pipeline for the reference batch * tests: retain case labels and 320-word diagnostics in the shared compute run --------- Co-authored-by: RavenCurseBurg <360931527+RavenCurseBurg@users.noreply.github.com> Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…0Y00#2617) Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
- Preserve ordinary vector ALU classification and translator refusal. - Exercise the authored encodings and dashboard categories. Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…2611) An unplaced buffer memory SRV (device slot 70, R0Y00#2395) wrapped the whole allocation holding the view with OpenExistingHeapFromAddress. A 6 KiB view in a ~2.15 GiB title startup block wrapped the block; afterwards each VirtualQuery over it took seconds and DirectStorage requests stalled for ~120 s. Wrap only allocations up to the existing 256 MiB span limit (size from one region-information call); larger ones take the upload copy. Co-authored-by: lukaslw-lab <291379150+lukaslw-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… with CLI suite (R0Y00#2620) Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
… gfx2hlsl (Part of R0Y00#1723) (R0Y00#2082) * feat: lower image_sample_d to SampleGrad in gfx2hlsl Part of R0Y00#1723. 2D, 2D array and 3D gradient samples; image_sample_c_d is refused by name (needs SM 6.8). * test: register startup_image_sample_d in CMake Part of R0Y00#1723. * startup: keep the guest LOD cap for image_sample_d and document the form in gfx2hlsl * test: WARP and hardware readback for image_sample_d against a CPU reference * tests: build the implicit Sample negative control with two arguments --------- Co-authored-by: Royoo <3230853833@qq.com>
…0Y00#2622) Prove tip translate_mesh57 refuses a back-edge outside the accepted group-memory exchanges by the named loop reason, with a mutant that drops the back-edge and an exact-string oracle. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
… gfx2hlsl (Part of R0Y00#1723) (R0Y00#2069) * fix: carry descriptor pointers through s_add_u32/s_addc_u32 in gfx2hlsl A table or root pointer advanced by a literal offset now keeps its source and byte offset, so a following s_load reads the advanced descriptor. A register addend on a pointer is refused instead of silently keeping the old pointer. Part of R0Y00#1723 * shader: refuse descriptor pointer advances across branches and detached s_addc_u32 in gfx2hlsl (Part of R0Y00#1723) * shader: keep the pointer-advance bookkeeping safe for stages without branch state (Part of R0Y00#1723) * fix: keep the branch-join refusal for pointer adds in branching shaders * fix: require the matching high-word add before folding an advanced descriptor pointer * fix: advance 32-bit table pointers without a high word and judge the high operand by content * fix: keep descriptor pointer pair open until its matching s_addc_u32 * fix: let the descriptor pointer pair pass translate's SCC check, add WARP readback case * fix: refuse an untracked-offset pointer as a descriptor, run the pointer check in Linux CI * fix: refuse a root pointer load whose high word was overwritten * Revert "fix: refuse a root pointer load whose high word was overwritten" This reverts commit 0f226c5.
…#2634) shader_cache_rekey.py re-keyed graphics, RTV and slot 67 compute requests and only counted slot 57 mesh requests. mesh57_key hashes the request files under a versioned prefix, so after a revision that changes it a kept cache lost every slot 57 request. The tool now recomputes that key with mesh57_key and copies .ps57, .root and the .m57 ready marker under the new name, with the rules the other kinds follow: everything read first, nothing written on a missing or unreadable part, temporary name then rename, an existing target left alone. Slot 86 is still only counted. AI-assisted.
…shader_census with CLI suite (R0Y00#2437) * shader: extract main(argv), bounds checks, and struct/zlib guards in shader_census with CLI suite * tests: accept Python 3.14+ argparse message in shader_census_cli_check --------- Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…R0Y00#2636) Track ordinary and oversized compute view heaps separately from the graphics lookup. Keep the table when the same heap is rebound and clear it on changes or unset. Cover the recorder in the CPU checks. Co-authored-by: chasegrindy <302242206+chasegrindy@users.noreply.github.com>
…0Y00#2635) Co-authored-by: RavenCurseBurg <360931527+RavenCurseBurg@users.noreply.github.com> Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
…2638) * shader: lower s_bitset0/1_b32 in gfx2hlsl (R0Y00#2023 Item J) Port the pixel_aot bit set/clear SOP1 forms so ordinary vertex and pixel pipelines that only need an in-place scalar bit update stop refusing at s_bitset1_b32. SCC stays unchanged; lane masks and descriptor SGPRs refuse. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * test: pin sopk descriptor-refusal mutation to sopk-only raise s_bitset0/1_b32 reused the plain-scalar sym allow-list line, so the sopk_accum mutant needle was no longer unique. Match the sopk raise that formats with `base` instead. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
…0Y00#1974) * feat: record command-list slot 14 Dispatch on the desktop list Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise. * startup: refuse Dispatch under a compute root with unforwarded arguments, document slot 14 * startup: gate Dispatch on bound compute root SRVs and a pipeline built against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused. * fix: pass pipeline root out-param in slot86 mesh cached pipeline build * tests: drive native slot 14 Dispatch through the stand-in startup_list_dispatch_native creates a guest device on a desktop adapter (WARP or hardware, debug layer on when installed) and drives command-list slots 86, 25, 33, 43, 148, 14, 9 and 139 of the stand-in. Each refused case must write exactly one "x2w-render Dispatch(x, y, z) refused: <reason>" line, with the expected reason, to X2W_TRAP_LOG: - a root SRV never set; - a rejected (foreign address) or misaligned slot 43 replacement after a valid one; - a root changed and changed back without a new slot 43; - a pipeline built against another root; - a root with a descriptor table, and a root with a static sampler; - an unset root SRV with zero groups; - 65536 groups on X; - a Dispatch on the closed list; - a Dispatch after Reset without new bindings. A forwarded case must write no line. The fixture wraps a pipeline-statistics query around every slot 14 call on an open list, recorded on the underlying desktop list: CSInvocations must be 4 per group when forwarded and 0 when refused. The fully bound call is recorded alone and read back first, so a slot 14 that records nothing fails on its count. All three recordings are executed to a fence and the debug layer must report no error. The skip_srv control drops slot 43 from the first forwarded case and must report it as refused. Each of these one-line changes to d3d12_xs_device.cpp makes the WARP and hardware tests fail: the refusal branch never taken, compute_srv_bound not cleared by slot 33, the bit not cleared by a rejected slot 43, compute_root_has_arguments forced false, root_matches_pipeline forced true, and the slot 14 registration removed. The docs section now names the device fixture and corrects the sentence on which compute root-argument slots have handlers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: list_dispatch header names slot 43 as forwarded --------- Co-authored-by: The Void <mrdominogrm@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Royoo <3230853833@qq.com>
…ews (Part of R0Y00#870) (R0Y00#1975) * startup: record SetComputeRoot32BitConstant(s) (list slots 37, 39) Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them. * fix: track which compute root constant words were set; drop slot 40 claim
…joins (R0Y00#2507) * fix: carry descriptor pointers through s_add_u32/s_addc_u32 in gfx2hlsl A table or root pointer advanced by a literal offset now keeps its source and byte offset, so a following s_load reads the advanced descriptor. A register addend on a pointer is refused instead of silently keeping the old pointer. Part of R0Y00#1723 * shader: refuse descriptor pointer advances across branches and detached s_addc_u32 in gfx2hlsl (Part of R0Y00#1723) * shader: keep the pointer-advance bookkeeping safe for stages without branch state (Part of R0Y00#1723) * fix: keep the branch-join refusal for pointer adds in branching shaders * fix: require the matching high-word add before folding an advanced descriptor pointer * fix: advance 32-bit table pointers without a high word and judge the high operand by content * shader: keep 32-bit table offsets at agreeing forward graphics joins Track a literal table address across copies and forward paths only when the incoming resource and byte offset agree. Exercise the published manifest against two GPU resources and compare all 32 pixels, including the root constant used by the branches. AI-assisted with Codex (GPT-6.2 Astra, xhigh). * fix: keep descriptor pointer pair open until its matching s_addc_u32 * tests: cover vertex-table carries and backward edges in pointer propagation Exercise the two surviving mutations reported on R0Y00#2507 using full source-built programs. AI-assisted with Codex (GPT-6.2 Astra, xhigh). * fix: let the descriptor pointer pair pass translate's SCC check, add WARP readback case * fix: refuse an untracked-offset pointer as a descriptor, run the pointer check in Linux CI * fix: refuse a root pointer load whose high word was overwritten * Revert "fix: refuse a root pointer load whose high word was overwritten" This reverts commit 0f226c5. --------- Co-authored-by: tedin7 <tommasoderosa94@gmail.com> Co-authored-by: RavenCurseBurg <360931527+RavenCurseBurg@users.noreply.github.com>
* tests: split four long CPU checks into parallel ctest cases * docs: say in the file headers that CTest runs the parts and check runs them all * fix: let the no-path x87 aggregate modes parse without file arguments
cursor
Bot
force-pushed
the
cursor/gfx2hlsl-s-quadmask-5a9e
branch
from
November 26, 2026 01:47
9907580 to
e6c2612
Compare
… boundary (R0Y00#2631) * startup: give the placed page aliases and the draw dumps the teardown boundary Four function-local statics in the shim own desktop D3D12 objects and are destroyed during the module's CRT teardown, which runs at process exit after Windows has detached the display driver. R0Y00#2590 fixed the two the startup_indirect runs fault in (the indexed-validation pipeline and the rectangle-list converter). This adds the two it did not touch: - the placed page aliases of the translated indirect address route, which the translated-indexed-alias run does populate: a probe reports two placed pages still held when the process exits; - the draw-dump readbacks, which fill only when a dump frame is requested. Both detach their references when DllMain saw a process detach carrying lpReserved, and release them normally on FreeLibrary, through the flag in startup_stubs/d3d12_teardown.h. In the page cache begin()/end() keep the lookup and free-slot scan unchanged; in the readbacks the destructor walks entries_. The heap and page words stay plain addresses, not owned. Neither site is a crash reproduced here: with the detach disabled, the alias run still exits 0 while releasing its two pages at teardown. The boundary is made uniform with R0Y00#2590's, which is where the fault was reproduced. The remaining static of this shape, RedProducers in red_producer_diagnostic.inl, is safe by construction: its live instance is heap-allocated and never destroyed, and the static fallback is built through the Disabled tag and owns nothing. * tests: exercise the placed page aliases and the draw readbacks through unload and exit The review asked for a source-built check of the ownership change: the alias run establishes that the cache is populated, but it exits the same way with or without the guard, and the draw-dump path had no populated test at all. x2w_d3d12_cached_objects_probe grows two bits. Bit 4 creates a heap and a placed buffer on the desktop device, enters it where the translated indirect address route keeps its aliases and answers 1; bit 8 creates the readback buffer and the fence a recorded dump holds and answers 2. startup_teardown_unload now covers four caches. On unload it requires each one to give back what it took: the device reference count for the two original caches, the entry's own object count for the two new ones, which hold no reference on the device. On process termination the child reports through X2W_TEARDOWN_REPORT how many references each cache detached and how many it released, and the parent requires detached=<owned> released=0. The test then re-runs the child once per cache with X2W_TEARDOWN_NO_GUARD=<cache>, which turns that cache's detach into a normal release, and requires the check to fail: without it the guard would be untested, which is what the review said. Two defects surfaced while building it. The probe answered 0 because a fixture created without a parameter block gets a bare D3D12CreateDevice device back, which is not in the shim registry, so as_wrapper() finds nothing -- that device is already the desktop one and is now used as such. And widen() kept the terminating null MultiByteToWideChar writes with -1, so CreateProcessW truncated the child command line. * tests: hand the placed page heap to the fixture so it outlives the buffer The probe kept the heap alive by detaching the creator's reference, which abandoned it: the cache holds only a non-owning heap pointer, so after FreeLibrary nothing owned the heap that backed the placed buffer. The probe now hands the heap over with a reference the fixture owns, and startup_teardown_unload holds it across the unload, checks that the placed buffer was released first, and then releases the heap last: warm placed-pages: backing heap handed over with 1 reference unload placed-pages: heap alive after the unload, 1 reference, placed buffer released first unload placed-pages: heap released last, 1 -> 0 Releasing after FreeLibrary is safe here because the heap is a D3D12 object created on the desktop device, not on the shim: its vtable lives in d3d12.dll, and the fixture still holds that device at that point. The reference-count and process-exit controls for the alias, the readback and the fence are unchanged. * Unload the placed-cache fixture before dropping its backing heap on error --------- Co-authored-by: panam <panam@local> Co-authored-by: Royoo <3230853833@qq.com>
…hed ones (R0Y00#2649) * runtime: give unknown-dimension views a default view and skip mismatched ones Desktop D3D12 removes the device for a view description with ViewDimension 0 (UNKNOWN) or a dimension that does not suit the resource, instead of failing the call. A console package module made such SRVs on 2D RGBA8 textures. Views of device slots 18 to 21 are now checked first (view_dimension.h): dimension 0 gets the resource's default view (null description) where desktop allows one, else the view is skipped; a mismatched dimension is skipped. Both are logged, and a view that still removes the device logs its forwarded description and the resource's shape. New fixture with a negative control: startup_view_dimension; the control swaps the resource dimension of the mismatched cases. * runtime: limit unknown-dimension default views to typed SRVs and null refused SRVs The default view for a view description with ViewDimension 0 replaces the whole description, including its format and component mapping. Only the shader resource view case is measured, so by default only slot 18 views of typed, non-depth textures get it. UAV, RTV and DSV descriptions with dimension 0 are skipped unless the experimental X2W_D3D12_VIEW_DEFAULTS=all is set; =off skips the SRV case too. A refused SRV now writes a null SRV into its destination descriptor. The skipped call used to leave the slot's previous descriptor there, bindable and copied by CopyDescriptors, after the slot's record had dropped the reference that kept its resource alive. New fixture startup_view_dimension_warp (and _hardware) through d3d12_xs.dll: an unknown-dimension SRV samples its texture's colour, an explicit TEXTURE3D SRV of a 2D texture is refused without device removal, and a refused replacement over a valid view reads zero, as does a copy of that slot. startup_view_dimension_off_control_warp runs it with X2W_D3D12_VIEW_DEFAULTS=off and must fail on the missing default view alone, with the device not removed. * Preserve live non-SRV descriptor records when a replacement is refused --------- Co-authored-by: Royoo <3230853833@qq.com>
R0Y00#2606) * startup: write nothing for the null export target in gfx2hlsl The null target carries no channel; its only effect is the vm discard emitted before it. Same change as the open R0Y00#2026, so a rebase onto it drops this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: translate slot 57 mesh requests with a depth-only pixel stage (Part of R0Y00#2413) A pixel stage whose only export is the null target was refused with 'slot 57 mesh with a depth-only pixel stage is not covered'. It now translates with the pair: the pixel stage has no SV_Target, keeps the vm discard of an alpha test, and the manifest has an empty targets line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: refuse a slot 57 null export mixed with another export (Part of R0Y00#2413) The slot 57 depth-only profile is a pixel stage whose only export target is null. A null export before or after an mrt0, mrtz or param0 export passed the role check and was published; it is now refused in translate_mesh57 before any source or manifest is written. The general pixel path keeps its mixed forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…#2641) * shader: lower s_flbit_i32_b32 in gfx2hlsl (R0Y00#1723) Port the pixel_aot leading-zero count SOP1 (31 - firstbithigh, -1 if zero). SCC is unchanged. Lane masks and descriptor words are refused. CPU fixture with a negative control. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * docs: note s_flbit_i32_b32 startup lowering (R0Y00#1723) Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * test: add D3D12 WARP dispatch readback for s_flbit_i32_b32 Mirror the s_ff1 / s_abs UAV dump pattern. Cover zero (0xffffffff), bit 0, bit 31 and a mid-word bit so firstbithigh is exercised on the adapter. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * docs: note s_flbit_i32_b32 WARP dispatch ctest Document the UAV-readback filter next to the CPU-only command. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
…ription (R0Y00#1629) (R0Y00#2592) * startup: take pixel input masks from the exact pipeline's stream description (R0Y00#1629) Pipeline lays out the entry VGPRs by SPI_PS_INPUT_ADDR and loads them by SPI_PS_INPUT_ENA, so distinct masks are accepted; an enabled input that is not allocated is refused as contradictory. request_ps_inputs() reads the separately captured description req_<key>.psin and refuses one that names another pipeline (key in the line or recomputed pipeline_key), a missing enable or address mask, or a malformed line. translate_request and request_refusals pass the masks on; no description keeps today's model. tests/startup_packed_position_provenance_check.py: a source-built target (position in v4 from enable 0x8002 / address 0x8003) and a decoy (v2) in one cache directory; pure controls, then the R0Y00#1634 gradient draw on WARP and hardware with a wrong-register control. The R0Y00#1634 check is unchanged. * startup: make the pixel input masks part of the request identity (R0Y00#1629) Two pipelines with identical stage bytes, root signature and input layout but different SPI_PS_INPUT_ENA/ADDR masks hashed to the same pipeline_key(), so they shared every request file name and the second description replaced the first in the cache. - pipeline_key() takes the description's masks (ps_inputs) and hashes b'psin1' + ENA + ADDR (little-endian u32) after the input layout, as the layout itself is hashed. Without a description the key is unchanged, so existing caches keep their keys. - request_ps_inputs() recomputes the key with the masks. A description rewritten with another mask pair under an existing key is refused by name (pixel input description names another pipeline), and the result already published for that key is withdrawn instead of being served. - pending_keys() checks a published result again when its description is newer than its manifest; translate_request() marks the manifest as checked when the description still matches, so the check runs once. - The base and RTV source key check in load_request (R0Y00#2595) and shader_cache_rekey.py hash the masks too; with a description, a base key mismatch is reported as the description naming another pipeline. The re-keyer rewrites the description line under the new key. The provenance check gains same-cache controls: three pipelines with the target's exact bytes and three mask pairs get three keys and each takes its own masks; a different pair after a result exists is translated as its own request and leaves that result untouched; an in-place rewrite is refused and withdrawn. The draw mode adds two same-byte pipelines to the target's cache (0x8003/0x8003 draws the gradient, 0x8002/0x8002 fails at (1,0) as expected) and checks the compiled-result path with FXC. * startup: watch the stream description each translation reads (R0Y00#1629) An RTV variant is translated from its source pipeline's blobs and stream description, but pending_keys compared req_<variant>.psin with the variant's manifest, and a failure was retried only when .a or .rtv changed. A wrong mask pair written into a base description therefore withdrew the base result and left the variant's result published, and a corrected description did not requeue the refused request. request_source() now names the request's source key and the one description its translation depends on (req_<key>.psin for a base request, req_<source>.psin for a variant). load_request, request_ps_inputs and pending_keys all use it: a description newer than the manifest rechecks the result, and a description newer than the .fail retries the request, for base requests and variants alike. Requests without a description keep the legacy key and behaviour. The new control publishes a base and an `rtv1 <base> 28` variant, writes the wrong pair into the base description (both are refused by name and both manifests withdrawn), then restores the valid line (both are republished without touching .a or .rtv). * startup: withdraw results whose stream description was removed (R0Y00#1629) With a published base and an rtv1 variant of it, removing only req_<base>.psin left both manifests in place: pending_keys saw no description and nothing newer, so the watcher kept serving results that a forced translation refuses (shader request source key mismatch and RTV variant source key mismatch). - translate_request writes <key>.psdep, the description line the result is translated with, before the manifest is published, for a base request and an RTV variant alike. A legacy request that never had a description gets no record. - pending_keys queues a published result again when it has a record and the description request_source() names is gone. A request without a record is not read again, so legacy caches keep today's cost. - translate_request refuses such a request by name, "pixel input description missing for a request translated with one", and withdraws its manifest. The refusal is not retried until the description is written again, newer than the .fail. The provenance check keeps the wrong-pair and restore controls and adds: both results record their description line; removing only the base description queues the base and its variant, refuses both by name and withdraws both manifests; nothing is retried while it stays missing; the restored description republishes both; a legacy request publishes without a record and stays done. * startup: recheck a result whose description is gone despite an old .fail (R0Y00#1629) On the manifest-only path a successful translation leaves an earlier .fail in place. A published result whose recorded stream description was later removed then fell through to the failure check, which compared that old .fail only with the request file (no description time is left) and skipped the result, so its manifest stayed published. pending_keys now queues such a result while its manifest exists; the translation refuses it by name and withdraws the manifest, and the new .fail keeps it from being retried until the description returns. The provenance check no longer deletes the failures of the wrong-pair cycle before removing the description, so it covers this order.
…p to R0Y00#2082, Part of R0Y00#1723) (R0Y00#2646) * test: use the wide tuple spelling for image_sample_d fixtures that LLVM 15 assembles Follow-up to R0Y00#2082. The assembler needs the full 8 VGPR (16 for a volume) tuple; the decoder lists the active registers. * ci: run the image_sample_d fixture check against llvm-mc-15
cursor
Bot
force-pushed
the
cursor/gfx2hlsl-s-quadmask-5a9e
branch
from
November 26, 2026 02:09
c766c85 to
5aad999
Compare
… the CPU (Part of R0Y00#2413) (R0Y00#2680) * startup: write nothing for the null export target in gfx2hlsl The null target carries no channel; its only effect is the vm discard emitted before it. Same change as the open R0Y00#2026, so a rebase onto it drops this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: translate slot 57 mesh requests with a depth-only pixel stage (Part of R0Y00#2413) A pixel stage whose only export is the null target was refused with 'slot 57 mesh with a depth-only pixel stage is not covered'. It now translates with the pair: the pixel stage has no SV_Target, keeps the vm discard of an alpha test, and the manifest has an empty targets line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * startup: refuse a slot 57 null export mixed with another export (Part of R0Y00#2413) The slot 57 depth-only profile is a pixel stage whose only export target is null. A null export before or after an mrt0, mrtz or param0 export passed the role check and was published; it is now refused in translate_mesh57 before any source or manifest is written. The general pixel path keeps its mixed forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tests: draw a slot 57 depth-only pair and compare depth with the CPU A source-built gfx1013 pixel stage narrows EXEC with v_cmpx and exports only to the null target. The pair is drawn twice into a D32 target cleared to the sentinel 1.0 (depth test LESS) on WARP and hardware; colour must stay cleared and depth must match the CPU rasteriser, so covered and discarded pixels are told apart. A reference without the depth writes and the same mesh without the discard must each fail. Offline controls refuse the drawn stage with a colour export before its null export (the slot 57 mixed-export refusal) and a mismatched pair in both directions, and check that pending_keys needs both bytecodes. Part of R0Y00#2413 --------- Co-authored-by: NiiRoZz <simonin.remi25@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Royoo <3230853833@qq.com>
…for v_readfirstlane_b32 (R0Y00#2446) * gfx2hlsl: prove a compute buffer load with a uniform address uniform v_readfirstlane_b32 needs a vector source with the same value in every active lane. A buffer_load_dword or buffer_load_format_x in a compute program reads a read-only descriptor (a descriptor used for a load and a store is already refused), so with a uniform VGPR index or offset, a uniform scalar offset and exec known in the entry block, every lane reads the same dword. Mark the destination uniform there. The value has no recomputable expression, so reads past the entry block still refuse. Tests: positive cases plus negative controls for a varying VGPR offset, a varying scalar offset, a graphics stage, no stage kind, unknown exec, a read after the entry block and a varying overwrite. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * test: WARP readback for readfirstlane of a uniform buffer load Compute case N: v_readfirstlane_b32 of a buffer load at a uniform address, xored into each lane's own word, dispatched on D3D12 and compared with a CPU reference. A per-lane address is refused. Control n-dropped-broadcast must mismatch. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…tem F) (R0Y00#2639) * shader: lower s_ff1 of a general scalar (R0Y00#2022 Item F) Keep the compute-entry exec_lo fold to lane 0, and add firstbitlow / lo-then-hi scan for ordinary SGPR and immediate sources. Lane masks and descriptor words stay refused. CPU fixture with a negative control. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * shader: keep s_ff1 b32 general; leave b64 SGPR pair to R0Y00#2072 Refuse live s_ff1_i32_b64 SGPR pairs (owned by open R0Y00#2072). Keep zero-extended b64 immediates and add a D3D12 UAV dispatch fixture for the b32 edge words (including firstbitlow(0) == 0xffffffff). Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * shader: keep s_ff1_i32_b64 out of SCALAR_BITS after rebase Main's SCALAR_BITS install was overwriting Stage.op_s_ff1_i32_b64. Leave the dedicated handler for zero-extended immediates (R0Y00#2022 F / R0Y00#2072). Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * shader: lower s_ff1_i32_b64 SGPR pairs after R0Y00#2072 merge Keep the Stage handler for zero-extended immediates and emit the same 64-bit firstbitlow scan for register pairs so bit_scan CI stays green. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * test: read back s_ff1_i32_b64 of a live SGPR pair on D3D12 (lo/hi cases against a CPU reference) --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
Co-authored-by: R0D4X <R0D4X@users.noreply.github.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…translator (R0Y00#2432) Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
Port the pixel_aot nibble-collapse SOP1 (each 4-bit group to one bit of D). SCC is the nonzero test of the result. Lane masks and descriptor words are refused. CPU fixture with a negative control. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/gfx2hlsl-s-quadmask-5a9e
branch
from
November 26, 2026 02:15
5aad999 to
10886c3
Compare
Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…t indexes (R0Y00#2532) * feat: record the compute root signature and descriptor tables (slots 33 and 35) Header-only state in list_compute_root.h with a Linux-testable check. Dispatch (slot 14) is not handled here; the state is exposed through ready() and table() for it. Refs R0Y00#870. * feat: record compute descriptor tables (slot 35) and clear them on a root or heap change * startup: record SetComputeRoot32BitConstant(s) (list slots 37, 39) Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them. * feat: record command-list slot 14 Dispatch on the desktop list Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise. * startup: refuse Dispatch under a compute root with unforwarded arguments, document slot 14 * startup: gate Dispatch on bound compute root SRVs and a pipeline built against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused. * startup: record SetComputeRoot32BitConstant(s) (list slots 37, 39) Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them. * feat: record command-list slot 14 Dispatch on the desktop list Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise. * startup: refuse Dispatch under a compute root with unforwarded arguments, document slot 14 * startup: gate Dispatch on bound compute root SRVs and a pipeline built against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused. * fix: pass pipeline root out-param in slot86 mesh cached pipeline build * fix: track which compute root constant words were set; drop slot 40 claim * Dispatch translated compute programs with raw table buffers A device slot 67 placeholder keeps the key of its published request. At list slot 14 the stand-in loads the stage cs manifest and compiled program for that key and records the dispatch: raw buffer inputs and outputs from hardware descriptors in the recorded compute tables, entry values from the recorded compute root constants. Other manifest lines leave the pipeline untranslated; a dispatch that cannot be bound completely is refused with one logged reason and records nothing. startup_compute_dispatch_{warp,hardware} drives a source-built program through the stand-in list and reads the output back, with controls before translation, without a Dispatch and for a refused output. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Log untranslated compute dispatches on their own line budget Dispatches that arrive before the offline translation no longer use up the lines kept for refusals at bind time. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Count compute dispatches per key with their first refusal The per-call refusal lines share one small budget, so a run cannot rank keys by dispatch count. Each key now keeps its Dispatch count, the calls recorded and the reason and table descriptor of its first refusal; the periodic totals are followed by the refused dispatches per reason and the 40 keys with the most dispatches. A manifest that exists but cannot be bound is counted apart from an absent one ("not modelled"). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Dispatch translated compute programs that store to 2D textures A `uav <i> tex2d float table <param> <byte> channels 4` manifest line is bound from the token of the unordered access view the title created in its descriptor memory. Everything else is refused with its own reason: an entry that is no such token, a view the desktop did not create, a view that is not 2D, a format a float4 store cannot target, and a texture bound to two slots of one dispatch. Programs without entry values, inputs or outputs load too: the translated root no longer emits an empty range or drops the table when only outputs exist. The fixture stores through the stand-in's own list into a 32x8 RGBA16_FLOAT texture and reads it back with CopyTextureRegion. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Dispatch translated compute programs that read 2D textures A `srv <i> tex2d table <param> <byte>` manifest line is bound from the token of the shader resource view the title created, through the texture the draw path samples for that resource, uploaded first when the title filled it in memory. `smp` lines become static samplers of the translated root. A dispatch is refused, never bound to a null view, when the entry is no such token, the resource has no desktop texture, the view is not 2D or names a packed format, or the upload fails. Sampler heaps, comparison samplers and other texture kinds keep the translation unavailable. The fixture samples a 1x1 texture into the stored words of the raw buffer case; without a view the dispatch is refused and the output is untouched. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Check a compute manifest without entry values at Dispatch Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Document texture views and the census of translated compute Dispatch Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Check the device on every 64th translated Dispatch and drop a liveness test The device check drains the debug layer; a draw runs it on every 64th call and the queue's execute drains the rest. A view token whose resource the caller released is the caller's misuse, as on the draw path. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Compute dispatch: allow two outputs of one texture, refuse packed outputs, print every census key A texture is refused only when the same call reads and writes it; two outputs of one texture share the unordered access state. A packed output view format gets its own refusal reason. The census prints every dispatched key instead of the first 40, and the wording on refused calls says what may already be recorded (an input texture upload). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * startup: compute input named by a resource heap record a root constant indexes gfx2hlsl.py lowers one form of a register-offset load through the directly indexed resource heap pointer of a compute root signature: s_lshl_b32 R, <root constant word>, 5 s_load_dwordx4 D, s[H:H+1], R ; s[H+1] a constant zero, no offset: with no write of R and no branch target in between. D is a buffer descriptor and the manifest names it `srv <i> buf heap rootconst <parameter> <word>`. Every other form keeps a refusal that names it, including an index read from a buffer. The stand-in records the title memory of the list's view heap on every slot 32 call (it kept only the sampler heap and, for oversized heaps, the wrapper) and a Dispatch reads the 16-byte descriptor at byte `word << 5` of that memory, then binds it through the path a table record takes. A record outside the heap refuses the dispatch and binds nothing. Checks: tests/startup_gfx2hlsl_heap_record_check.py (manifest and HLSL exact, 19 refused controls, one translator mutation, LLVM 15 reassembly) and tests/startup_compute_dispatch_heap_check.py on WARP and a physical adapter. Refs R0Y00#2274 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * startup: drop a heap record control whose branch target was inside an instruction The second positive case of startup_gfx2hlsl_heap_record_check.py branched to the second dword of the two-dword heap load. The case with a branch target before the shift already covers the form outside the entry block. The experiments entry now says that WARP's descriptor increment is not 32 bytes. Refs R0Y00#2274 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * startup: read the stage kind as the other handlers do in the heap load A check added on main calls op_s_load_dwordx8 on a stage built without a kind; the heap record branch read self.kind directly. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * startup: avoid calling the compute driver after process termination begins The slot 67 cache owns desktop COM objects until module teardown. During process termination, the driver can already be shut down when static destructors run. Keep normal reference release on explicit unload and skip driver calls only during process termination. AI-assisted with Codex (GPT-6.2 Astra, xhigh). * Repair a broken line in the dispatch check Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Pin four existing texture dispatch refusals: integer view format, manifest version, stage, output also an input Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Drop the repeated compute root reset left by merging two slot 14 snapshots list_compute_root cleared compute_srv_bound and recomputed compute_root_has_arguments twice; the second copy came from the second R0Y00#1974 snapshot merge and changed nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: tedin7 <tedin7@users.noreply.github.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com> Co-authored-by: RavenCurseBurg <360931527+RavenCurseBurg@users.noreply.github.com>
* shader: lower the SDWA form of v_cndmask_b32 in gfx2hlsl The VOP2 select in SDWA form was refused as "SDWA form of v_cndmask_b32". sdwa() now lowers it as a two-source integer operation: each source takes its src0_sel/src1_sel field (sext() sign-extends), the select reads VCC, its fourth operand, the way the plain v_cndmask_b32 does, and dst_sel/dst_unused place the result. clamp, float modifiers and UNUSED_SEXT stay refused. Test: startup_gfx2hlsl_sdwa_check.py pins the emitted text. startup_gfx2hlsl_sdwa_cndmask_check.py draws a constructed gfx1013 pixel stage with four selects over 16 x 16 pixels on WARP and hardware (FXC ps_5_1 and DXC ps_6_0): all 1,024 words match a bit model, and six mutated selects fail against it and match their own. Its binary mode requires LLVM 15 to assemble the fixture to the same words. With the previous translator the fixture is refused. * tests: keep an SDWA select draw failure across a later capability skip Review follow-up. run_pixel_words exited 77 on a renderer skip even after an earlier check had failed, so ctest reported a skip instead of the failure. It now exits 1 when a check has failed, as R0Y00#2380 did for the sibling draw fixtures. Test: with a check failed and the renderer returning 77, the old code exits 77 and the new code exits 1; without a failure both exit 77. --------- Co-authored-by: lewisalex86 <lewisalex86@gmail.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…Y00#1706) The VEC_U table lowers v_bfe_u32, v_mad_u32_u24, v_lshl_add_u32, v_add_lshl_u32, v_add3_u32, v_or3_b32, v_and_or_b32, v_lshl_or_b32, v_xad_u32 and v_bfi_b32, and no check ran any of them. tests/startup_gfx2hlsl_int3_alu_check.py draws them with the shared per-lane runner (tests/startup_gfx2hlsl_lane_alu.py, byte-identical to the copy in the two-source family PR): one operation per lane on flat inputs, exact result words, against references written from the RDNA 2 ISA (field extract with S1[4:0]/S2[4:0], 24-bit products, shift counts from bits 4:0, wrapping sums, bitfield insert), with widths and counts above 31, bits above bit 23 and wrapping sums. Each operation has one mutated lowering whose first draw must read its own mutated words. All 40 draws match on WARP and an RX 6600 through FXC ps_5_1 and DXC ps_6_0; the 20 mutated draws read their mutated words. Co-authored-by: x2w-worker <noreply@users.noreply.github.com>
…R0Y00#1745) The VEC_F table lowers v_rcp_f32, v_rcp_iflag_f32, v_sqrt_f32, v_rsq_f32, v_exp_f32 and v_log_f32 to 1.0 / x, sqrt, rsqrt, exp2 and log2, and no check ran any of them. tests/startup_gfx2hlsl_float_transcendental_check.py draws them with the shared per-lane runner (byte-identical copy of tests/startup_gfx2hlsl_lane_alu.py) on powers of two (and 0 and 9 for the square root), so every result is exact and the draw checks which function and which base each operation is lowered to, not its precision. Each operation has a mutated lowering whose first draw must read its own words. All 24 draws match on WARP and an RX 6600 through FXC ps_5_1 and DXC ps_6_0, and the 12 mutated draws read their mutated words. Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…s (X2W_TRACY) (R0Y00#2573) * startup: Tracy memory pools for XMemAlloc and the stand-ins' C++ heaps (X2W_TRACY) X2W_ALLOC, X2W_FREE and X2W_PLOT join the zone macros. XMemAlloc/XMemFree feed the pool "XMemAlloc", each instrumented DLL reports its operator new/delete as "<target> C++ heap", and XMemVirtualAlloc commits are a cumulative plot (the title frees those ranges with Win32 calls). Without the option the macros are no-ops. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * test: guard the X2W_TRACY operator new/delete replacement --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…Y00#1673) Refs R0Y00#1546. The four binary32 forms of the compute store profile (v_add_f32, v_sub_f32, v_subrev_f32, v_mul_f32) also lower in their VOP3 _e64 spelling when a source carries a modifier as LLVM 15 prints it on a register: -v, |v| or -|v|. The modifiers are sign-bit operations on the word, abs first and then neg, as pixel_aot does for v_cvt_f64_f32_e64 and the binary64 compare sources, so a signed zero or NaN payload keeps its other bits and no float abs() or negation is emitted. No opcode is added. The unmodified _e64 spelling and modifiers on the _e32 spelling stay refused at the instruction. clamp and mul:2, mul:4, div:2 are refused with "Unsupported float output modifier"; abs(), neg(), unbalanced bars and modifiers on constants with "Unsupported float source modifier". The fixture in tests/compute_alu_negabs_check.py puts each modifier on two operations, over values of both signs and signed zeros. On WARP the three read dispatches pass with all 320 words compared; 12 wrong references (each modifier dropped or exchanged) and 12 mutated HLSL sources (each abs mask or sign flip dropped, or a flip made an abs) each fail. A binary mode for the Ubuntu LLVM 15 job checks that the disassembly prints the five modified lines and translates identically. Run: ctest --preset dev --no-tests=error -R '^compute_store_aot_f32_negabs_(warp|hardware)$' -V Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
The VEC_F table lowers v_floor_f32, v_ceil_f32, v_trunc_f32, v_fract_f32 and v_rndne_f32 to HLSL floor, ceil, trunc, frac and round, and no check ran any of them. tests/startup_gfx2hlsl_float_round_check.py draws them with the shared per-lane runner (byte-identical copy of tests/startup_gfx2hlsl_lane_alu.py) against references written from the RDNA 2 ISA: signed zero results, round half to even, and fract capped at 0x3f7fffff, on exact halves and quarters, 1000000.5, the binary32 just below 0.5, 8388607.5 and -2^-30. Each operation has a mutated lowering whose first draw must read its own words. All 20 draws match on WARP and an RX 6600 through FXC ps_5_1 and DXC ps_6_0, the 10 mutated draws read their mutated words, and frac(-2^-30) reads 0x3f7fffff on both adapters. Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
R0Y00#2405 added s_mul_hi_i32 (and an early arity refuse for both mul_hi forms). The negative control still expected only one non-IndexError survivor. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
…0Y00#2659) * startup: accept sample_b and get_lod under entry EXEC after a join image_sample_b and image_get_lod refused any prior branch target even when EXEC was still the entry mask (M200-01 B/L: outside straight-line with every lane active). Drop the blocks gate; keep the pixel + exec_known proof. Fixtures: uniform join before the op accepted; divergent EXEC refused; WARP draw of join-before sample_b bias -1. Refs R0Y00#2618 Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * startup: require wave-uniform CF for sample_b and get_lod Review on R0Y00#2659: dropping only the blocks gate accepted vcc/exec branches before SampleBias / CalculateLevelOfDetail. Track uniform_cf (cleared by divergent s_cbranch_*), keep scc-uniform joins, and refuse vccz/vccnz/execz/execnz before the op in both fixtures. Refs R0Y00#2618 Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> * startup: refuse sample_b and get_lod inside a loop with a divergent back edge A divergent backward branch after the read still lets lanes of one quad leave the loop at different passes, so the read runs again with uneven quads although no divergent branch precedes it in program order. Record the read sites and the divergent back edges and refuse a read that one of them spans. Tests: synthetic words with s_cbranch_vccnz/execnz right after the read, back to it (fail before, pass after). * test: allow s_mul_hi_* own-arity templates in scalar table check R0Y00#2405 added s_mul_hi_i32 (and an early arity refuse for both mul_hi forms). The negative control still expected only one non-IndexError survivor. Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com> Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
…0#1703) * startup: draw the gfx2hlsl two-source integer vector operations The VEC_U table lowers v_add_nc_u32, v_sub_nc_u32, v_subrev_nc_u32, v_mul_lo_u32, v_and_b32, v_or_b32, v_xor_b32, v_not_b32, v_lshlrev_b32, v_lshrrev_b32, v_ashrrev_i32, v_min/max_u32, v_min/max_i32 and v_mul_u32_u24 to single HLSL expressions; no check ran any of them. tests/startup_gfx2hlsl_lane_alu.py turns the pixel fixture of startup_gfx2hlsl_bit_alu_check.py into a runner for table families: one operation per lane on flat inputs, alternating _e32 and _e64, exact result words, recorded llvm-mc bodies with a binary mode, controls for modifiers and operand counts, and one mutated lowering per operation whose draw must read its own mutated words. tests/startup_gfx2hlsl_int_alu_check.py is the first family. Its references follow the RDNA 2 ISA (wrapping arithmetic, rev shifts by S0[4:0], arithmetic shift, signed/unsigned order, 24-bit products) over inputs with shift counts above 31, sign-bit values, wrapping products and bits above bit 23. All 64 draws match on WARP and an RX 6600 through FXC ps_5_1 and DXC ps_6_0, and the 32 mutated draws read their mutated words. * build: close the foreach of the int_alu tests after merging main --------- Co-authored-by: tedin7 <tommasoderosa94@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Part of #1723: port
s_quadmask_b32frompixel_aotintotools/startup/gfx2hlsl.py.SCC = (D != 0)s_quadmask_b64stays refuseddispatchfixture (WARP/hardware) covering 0, a low nibble, bit 31,0x000f0000, SCC, and an SCC-dependent branch — same pattern as #2639 / #2640Claim before coding. Base is
main.AI-assisted.
Verification
Commit under test: this PR head.
python3 -B tests/startup_gfx2hlsl_s_quadmask_check.py # all ok python3 -B tests/startup_gfx2hlsl_handler_arity_check.py python3 -B tests/docs_links_check.pyAll passed on Linux (CPU evaluation). The
dispatchmode needs Windows + DXC +offscreen_check(not run on this Linux agent).Windows verification:
Evidence and follow-up
disasm_rdna2/gfx2hlsl.decode; no retail bytes.D,SCC, and anif (scc)branch token per case.Checklist