Skip to content

Addresses and descriptors of 0x218 programs - #100

Open
Castyan wants to merge 46 commits into
DexNom:mainfrom
Castyan:native-0x218-descriptors
Open

Castyan wants to merge 46 commits into
DexNom:mainfrom
Castyan:native-0x218-descriptors

Conversation

@Castyan

@Castyan Castyan commented Nov 26, 2026 •

Copy link
Copy Markdown

Stacked on #98 (0x218, itself on #64 and #61). The changes to review are the 3 commits after 60ff2e8.

What

  • e046271 A program whose lowering reads a value its block is not dominated by is now refused instead of panicking (seen on 0x218 m083). The check uses dominance. A unit test covers a phi input that is not dominated.
  • 3fc128a s_bfm_b64 of constants is folded into the words it writes. An execution test covers an immediate sampler built that way. The refusal "an address not from a root parameter" (the first in game before this) is now gone.
  • 1be2ae5 A structured buffer made raw, read by a typed load that names its format (tbuffer_load_format_xy ... offen format:[BUF_FMT_16_16_SNORM]). An MTBUF load takes its format from the instruction and, without idxen, its address from the byte offset alone, so it reads what the raw host view holds at that byte. Loads by index and buffer_load_format_* stay refused. Tests: resource tracking, and an execution test on the card and WARP; both fail without the change.

Results

Replay of two sets of 200 captured 0x218 descriptions on the RTX 5060: 1be2ae5 gains no program by itself. Its 22 programs now pass this point and stop further on (lane-mask joins, descriptors changed after loading, opaque lane masks). None lost.

Checks (RTX 5060, at 1be2ae5)

cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean. cargo test --workspace --locked: 744 passed, 0 failed, 11 ignored.

🤖 Generated with Claude Code

Castyan and others added 30 commits November 25, 2026 19:29
…to combined-preload-pops

# Conflicts:
#	Setup-DexNomRuntime.ps1
#	apps/victory/src/play_launcher.rs
#	apps/victory/src/translate.rs
#	crates/victory-gpu/src/descriptor/host.rs
#	crates/victory-gpu/src/host.rs
#	crates/victory-gpu/src/pipeline/make.rs
#	crates/victory-hle/src/modules/d3d12x.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn lanes

Three wave64 compute shaders (a 512-thread prefix over per-wave totals) were
refused on 32-lane hosts: inside a loop only one console wave's lanes run,
v_readfirstlane copies a running sum built from scalars and LDS alone. Two
host waves cannot exchange there (no group barrier inside the loop), but every
lane holds the same sum, so each host wave's own first lane is exact.

scalar_built() finds such VGPR values (VALU results and LDS reads of them,
phis at loop headers or where every predecessor runs on all lanes; guards
allowed), and remembers which a guarded write made: those are only taken by a
read that is itself inside a branch.

Fixes 9fc111d3be79364f, 77360df21e12ea43 and 39321a95223001ed on the
RTX 5060; their pipelines are now created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…change loop

Compute 7f61193d2c0e5f22 was refused by CreateComputePipelineState with
E_OUTOFMEMORY on the RTX 5060 and on WARP alike, although its DXIL validates.
Bisecting the console code down to one instruction: ds_add_rtn_u32 of
(0 - x) on group-shared memory. Host compilers turn atomicrmw add of a
negation into atomicrmw sub, which DXIL has no group-shared form of, and
refuse the pipeline; ds_sub_u32 (atomicrmw sub) fails the same way.

Both are now a load and a cmpxchg loop on old - x (lds_subtract); other
atomics keep their atomicrmw. A test runs ds_add of 0 - 1 and ds_sub of
0 - 1 over 32 threads and checks LDS on the card (32 and 96).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of DexNom#40 (notquiteog), unchanged. A console wave64 compute
program that no other form takes off 64-lane waves is refused by a 32-lane
host and every dispatch of it is dropped; the exact wave-wide form is tried
last, only for those. VICTORY_WAVE_WIDE=0 keeps the old refusal.

On the RTX 5060 this creates 22 of the 31 compute pipelines the title's
preload left refused for requiring WaveSize(64). The 9 left: 7 run groups of
several console waves (128 to 1024 threads), which the wave-wide form does
not take, and 2 are ray-tracing BVH builder programs (28918b7150a7aad5,
caa78b8ca62bc3d6) whose waves exchange across halves.

Co-Authored-By: notquiteog <notquiteog@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset decommitted
half of its allocation right after dropping the buffer placed over it.
The pages of a heap opened on private memory stay locked until the
runtime has destroyed the heap, and WARP may do that a moment after the
last reference goes: under the load of the whole victory-gpu suite the
decommit was sometimes refused (ERROR_INVALID_PARAMETER) and the test
failed, or the run ended in an access violation. About 2 runs in 15
failed this way, already on a65db62.

The test now retries the decommit for two seconds at most, drops its
command queue before releasing the allocation, and checks that the
release succeeds. 40 runs of the library in a row now pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test binary's random access violations were d3d10warp.dll's own. Every
test that asks for the software adapter gets the same device (one per
adapter in a process), and two of them compiling and running compute
shaders at once crash its shader compiler: in JITBaseVariable::OptimizeCopy
as a ComputePipelineShaderJIT is torn down, under ExecuteCommandLists of
the indirect tests' harness, or in Task_CompileShader on its own worker
threads. Every stack caught under cdb had two or more indirect::tests::warp_*
tests inside it at once. They take turns now, with the in-place tests that
open the same adapter: under cdb, 50 of 588 runs of all tests crashed
before, none of 240 after; 150 plain runs passed.

frame's tick test tries again when a busy PC wakes a wait late.

Ported from avatarmanz/VIctory-7900XTX 160d222 (its WARP turn and frame
parts; its write watch change is left out here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f fxceless#854)

Port of 26600c6 from fxceless/victory-fork#854 by PiloteCode ("wave64
programs in a paired form on 32-lane hosts, mesh programs over 32 KiB
linked with their pixel program, and more"). Each console wave runs as
one host wave of 32 lanes, each thread two console lanes (n and n + 32),
with every per-lane branch taken by the whole wave and EXEC as each
lane's guard. It is tried after every other form for a wave64 compute
program the host refuses (VICTORY_WAVE_PAIRS=0 turns it off).

On the 31 wave64 compute containers from the RTX 5060 preload, 29 get a
pipeline (22 before): 02384a60fda6f2d0, 1d434307d981352a,
22338086ea4c5364, 2da4beb386509b77, 3b02415f67c6b0d8, 6832a9da15c2e584
and 6b82bc7d22016cb5 now take the paired form; the other 22 are
unchanged.

Adapted to this branch:
- Kept from this branch: scalar_built() and the v_readfirstlane own-lane
  read, lds_subtract() with Module::negated() (the PR's own LDS
  subtraction loop is left out), the wave-wide last resort from
  DexNom#40 (now inside emit_forms), the POPS translation from pops.rs,
  the structured view record count / picked address / puddle texture
  size paths and scalar UINT views (moved into descriptor_data.rs next
  to the PR's unused-descriptor path, which now only runs where this
  branch refused).
- Left out: the PR's second POPS implementation (ir::without_pops_wait,
  Shader::ordered and its test), which would have run beside pops.rs.
- The ray-tracing structure builder's programs (a spilled user-data
  table, as victory-gpu classifies them) are refused by the paired form:
  forcing them onto 32-lane hosts hung NVIDIA GPUs in Marvisak#2711.
  28918b7150a7aad5 and caa78b8ca62bc3d6 stay refused.
- The new modules are classified in lib.rs; a test that expected the
  parked mask to be opaque when built alone checks only the shared build;
  the descriptor size test fills the record-count root word the runtime
  fills.

Co-Authored-By: Pilote Production <75377040+PiloteCode@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two BVH builder programs (28918b7150a7aad5, caa78b8ca62bc3d6) were
the last wave64 compute programs refused on 32-lane hosts. They exchange
across the console wave's halves, which the per-half form got wrong and
which hung NVIDIA cards (Marvisak#2711). The paired form keeps
both halves in one host wave, so the refusal is dropped: all 31 wave64
compute containers from the RTX 5060 preload now get a pipeline.

The builder still runs only when victory-gpu allows it
(VICTORY_BVH_BUILDER=1 or VICTORY_RAY_TRACING=1) and every one of its
pipelines has a host pipeline; by default its dispatches stay dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e method 0x218)

The title calls device method 0x218 at start for every variant of its
small compute programs (mip generation of texture arrays), handing over
a 0x60-byte description: the root signature, then (address, size) pairs
of the program's registers, its code and its resource table. Until now
the call failed with a null output and the title went without these
pipelines.

The program is now read from the description (registers, console
resource table, code without its s_code_end padding) and wrapped in a
container of its own, which is translated and cached as the title's
containers are. Descriptions that cannot be read still fail with
E_NOTIMPL and a null output. Method 0x1c8 (native graphics pipelines)
stays refused: it needs the draw's render-target formats.

The descriptor tracer also folds s_bfm_b32 and a 64-bit s_mov of a
literal (zero extended), the two instructions these programs use to
build their fixed sampler; without them the sampler's origin was lost
and the pipeline refused.

On the five 0x218 captures from the RTX 5060, all five now get a
hardware pipeline and are created by the runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 0x218 commit cut the note on device method 0x1c8 down to one line
and dropped its `shortcut:` marker, which is how the repository lists
what is not implemented. It also put native_build.rs in the middle of
the sorted list of sources outside the translation, with a comment that
did not say why it is outside. The note and its marker are back, and
the entry now sits at the end of the list with the reason: native_build
only writes containers, which are hashed like any other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Descriptions captured in game showed three misreadings in the decoder of
programs handed to device method 0x218:

- The user-data dword and the stride were swapped. The byte in the
  packed word is the user-data dword: every entry of root slot k names
  dword 4 + k, inside the program's COMPUTE_PGM_RSRC2 user-SGPR count.
  The u32 before it is the stride (0x10 or 0x20 for structured buffer
  SRVs, 4 for images, as in the title's own containers). With the swap,
  the CBV of every accepted mip-generation program named user-data
  dword 0 instead of the table in dword 4. A root parameter that names
  user data the program does not have is now refused.
- The header count is not always that of the 0x41 entries (11 for 12
  seen), so the entries are told apart by their tag.
- Root type 0 is root constants, read as values from the user SGPRs
  (`v_mul_f32 v7, s5, v7`). They are now a root parameter of size/4
  SGPRs, with no used resource.
- The thread-group depth is the low half of its word; the high half
  holds something else (0x10 seen with 32 x 1 x 1 groups).

In game, 0x218 now makes over 2048 pipelines and turns down 32 to 63
descriptions (before: about 512 made, over 1024 turned down). Of eight
descriptions captured in game, all now decode and four reach a hardware
pipeline; the four others stop at translator limits (a descriptor
changed after loading, an address with two computed terms). The five
earlier captures still pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A description the decoder turns down used to be logged with a count
only, and one whose blocks could not be read was not logged at all.
The warning now gives the reason (which block, or the decoder's error)
and the description's twelve words.

With VICTORY_DUMP_NATIVE=<folder>, a description turned down is saved
there with the blocks it names, four of each reason and 200 in all, as
slot218-<n>-desc-<address>.bin and slot218-<n>-dNN-<address>-<size>.bin
with the reason beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Root type 1 in a console resource table is a root descriptor: a 64-bit
buffer address in two user SGPRs. The title's programs that use one (a
root SRV t1 in user data 7 and 8, the next slot at 9) build a buffer
descriptor around s7:s8 and load through it, so it becomes a root
parameter of two SGPRs and a used resource, as the title's containers
give one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flags' bit 5, which says 32 lanes in the title's containers, is
clear in every description captured from device method 0x218, so every
such program was taken as 64 lanes. The ones whose depth word has 0x10
in its high half are 32-lane programs: they move exec_lo alone, keep
scalars in vcc_hi and use VGPRs up to the 32-lane count of
COMPUTE_PGM_RSRC1 exactly (v143 of 18 granules in slot218-m005, v127
of 16 in m008, v40 of 6 in m007, beyond the 64-lane count). The others
move the whole exec and stay within the 64-lane count (v23 of 6 in
m002, v31 of 8 in run1-m004).

As 64 lanes, a v_cmp writing s[15:16] overwrote the first dword of a
descriptor in s[16:19] (m008 at 0x2f8, "a descriptor changed after
loading"), and the VGPR count was half the program's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Castyan and others added 16 commits November 26, 2026 20:28
The 0x218 programs read structured buffers by byte through a descriptor
the code rewrites after loading it: the stride cleared in dword 1
(s_and_b32 by 0xc000ffff), the record count in dword 2 multiplied by
the stride (s_mul_i32 by s_max_u32 of s_bfe_u32 of dword 1, 14 bits at
16, and 1), OOB_SELECT raw in dword 3 (s_or_b32 of 0x30000000, after
an s_and_b32 by 0xcfffffff). The tracker refused it as "a descriptor
changed after loading".

The memory and its size in bytes are the loaded descriptor's, and the
host's buffer views are raw already, so the tracker now takes the
rewritten descriptor as the load's. An access that reads it by index
or format is refused: with stride 0 the index adds nothing, where the
load's descriptor would scale it.

slot218-m005, m006 and m008 now get past these descriptors; with m007
they stop at "an address with two computed terms": a descriptor loaded
from s[10:11] plus s9 << 5, user SGPRs the resource table names no root
parameter for (a heap and its index, as far as the code shows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…late

The resource table of a 0x218 description names only some of the user
SGPRs a program reads: slot218-m007 loads a descriptor from s[10:11]
plus s9 << 5, where the table has entries for user-data dwords 4 to 6
alone. Word 0 of the description is the root signature, one of ours,
which keeps its serialized form; what s7 to s10 hold is in it.

With VICTORY_DUMP_NATIVE, every saved description now has that
serialized form beside it, as slot218-<n>-root.bin, and a description
whose program decodes but does not translate is saved too, its reason
being the translator's ("translation: GFX10 code at ..."). Such
descriptions were not saved before, so no capture showed what the
translator turns down. Root signatures are told from other objects by
their function table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The resource table of a 0x218 description names only some of the user
SGPRs a program reads (slot218-m007: entries for user-data dwords 4 to
6, a descriptor loaded from s[10:11] plus s9 << 5), and the translator
refused what it could not trace. The decoder now reads the root
signature the description names (an RTS0 part, alone or in a
container) and adds the parameters the table leaves out.

Every captured table places the parameters from user-data dword 4 on,
in order, a table taking one dword, root constants their count and a
root CBV two (slot 0 at 4 even when unnamed; a root CBV at 7 and 8, the
constants after it at 9), so the others are placed the same way and
only those. Nothing is guessed: the program is refused, with the reason,
when the table places a parameter elsewhere, when a parameter is cut by
the end of the program's user SGPRs, when user SGPRs are left past the
parameters (where a directly indexed heap would be: no capture places
one), for a root SRV or UAV (no table places one) and when the
signature cannot be read. Without a signature the table's layout is
used alone, as before.

The captures hold no root signature yet, so they replay as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two merged branches disagreed on root SRVs: the resource table
decoder reads one (root type 1, kind SRV, a 64-bit address in user data
7 and 8 that the program builds a buffer descriptor around), while the
root signature reader refused every root SRV as one no capture places.
In game, where a signature comes with every description, a program the
table describes in full would then have been turned down.

A root SRV in the signature is now a root descriptor of two dwords, as
a root CBV, and is taken when the table places it itself. One the
signature names and the table leaves out is still refused, as is every
root UAV: what they are read as is not known.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73d8513 refused every 0x218 program with user SGPRs left past its root
parameters, where a directly indexed heap would be. A game run with
ed45fe9 captured 200 descriptions with their root signatures: 196 end
their parameters exactly at their user-SGPR count, and the 4 with one
more have CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED in their signature but never
read that SGPR. The refusal only cost pipelines: over 1024 descriptions
were turned down in that run, against 32 to 63 before 73d8513.

Those SGPRs are now left unnamed. A program that reads one is still
refused, by the translator ("a hardware SGPR input"), so nothing is
placed there by guess. All 200 captured descriptions now decode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9eac44a read the root constants entry's byte as their size in bytes.
Against the 200 root signatures captured with their descriptions, that
byte is 4 whatever the count: 1, 2, 3 or 4 constants in the signature
(30 descriptions with 4, 6 with 2, 2 with 1, 1 with 3, all with byte 4).
Programs with more than one constant read SGPRs nothing named and were
refused ("a hardware SGPR input"), 35 of the 200 captures.

The table alone now gives the first constant, and the signature gives
the count of those it names, refused if they run past the program's
user SGPRs. Of the 200 captures, the hardware SGPR refusals are gone
and 11 reach a hardware pipeline (2 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 0x218 programs read SCC as a number through operand 253, src_scc:
s_mov_b32 sN, src_scc (283 times in the 37 captures refused for it),
s_add_u32, s_and_b32, s_or_b32, s_mul_i32, s_sub_i32, and VALU
v_mov_b32, v_add_nc_u32 or v_lshl_add_u32. The IR already records the
read of SCC for that operand, but the lowering refused it as "a special
operand (vccz, execz, scc, lds_direct)".

It is now the SCC bit, 0 or 1. A test runs s_mov_b32, s_add_u32 and
v_mov_b32 of src_scc after s_cmp_lg_u32 on the card and on WARP. Of the
200 descriptions captured in game, the special operand refusals are
gone and 17 reach a hardware pipeline (11 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four scalar operations the 0x218 programs use were refused by name:
s_pack_ll_b32_b16 (7 of the 200 captures), s_pack_hh_b32_b16 (4),
s_bitreplicate_b64_b32 (6) and s_bfm_b64 (1). s_pack_lh_b32_b16 comes
with the other two packs.

- s_pack_ll/lh/hh: the low or high half of src0 in the low half, the
  low or high half of src1 in the high half.
- s_bfm_b64: src0[5:0] ones shifted up by src1[5:0], in 64 bits.
- s_bitreplicate_b64_b32: each bit i of src0 in bits 2i and 2i + 1.

None of them writes SCC. A test runs each on the card and on WARP and
reads both halves of the 64-bit ones. Of the 200 captures, those
refusals are gone and 24 reach a hardware pipeline (17 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of fxceless/victory-fork#146 (67f7ff0) by davi713albano-coder.

image_store packs the channels its dmask enables into consecutive VGPRs
(16-bit halves with d16), in channel order, and writes 0 to the others.
DXIL's typed textureStore writes all four channels, and the host format
drops those past its width, so the disabled ones are written as 0.0.
A store with dmask 0 writes nothing.

Before, only dmask 0xF was taken, and the 0x218 programs' partial
stores were refused ("an image store of some channels", 60 of the 200
descriptions captured in game). Of those 200, 64 now reach a hardware
pipeline (24 before).

The channel order and the zeroed channels follow AMD's MIMG description
as the PR and other RDNA2 translators read it; the test checks this
lowering (10 masks, sparse and d16 ones included) on the host, not the
console's hardware. Adapted here: the test's HostShader takes the two
fields this tree adds.

Co-Authored-By: Castyan <120135015+Castyan@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buffer_store_format_x, _xy, _xyz and _d16_x by index were refused ("a
typed buffer store of some channels or at an offset", 19 of the 200
descriptions captured in game: 14 d16_x, 3 x, 2 xy, none at an offset).
They now write the channels they give first and 0 to the others, as
image_store writes the channels its dmask leaves out: a typed UAV store
writes all four channels and the host format drops those past its
width. A store at an offset is still refused, with its own message.

A test stores 1 to 4 channels and d16_x by index into a typed RGBA16F
buffer on the card and on WARP and reads all four back. Of the 200
captures, 78 now reach a hardware pipeline (64 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v_ldexp_f32 (src0 * 2^src1, src1 a signed integer) was refused by name
in 10 of the 200 descriptions captured in game. It is now three
multiplies by powers of two that each have a normal float form
(exponents -126 to 127), the exponent first clamped to -378..381: that
covers every exponent that can take a float to or from zero, a denormal
or infinity, and each product is exact until the last, which rounds as
a single ldexp would.

A test runs it on the card and on WARP against f64 references, past
both ends of the range (a result below the normal range may be flushed
to zero). Of the 200 captures, 88 now reach a hardware pipeline (78
before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second game run's captures (200 descriptions with their signatures,
including those that do not translate) show where a directly indexed
heap goes. Every program with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED in its
signature has one user SGPR more than its root parameters take (61),
every one with both heap flags two (43), and no other program has any.
The first is the view heap: those programs add an offset to it, load a
buffer descriptor there (s_load_dwordx4) and read its stride. They were
refused as "an address with two computed terms" or "an address not from
a root parameter".

The view heap is now a ResourceHeap parameter in the dword past the
root parameters, then the sampler heap a SamplerHeap one, when the
program's user SGPRs are exactly that many more; otherwise they stay
unnamed, as before. The translator already reads descriptors from a
ResourceHeap parameter at an index it computes.

Of those 200 captures, the "two computed terms" refusals are gone; the
programs now stop further on, mostly at "an address with an untracked
high half" (44). The 200 earlier captures replay as before (88 reach a
hardware pipeline).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 0x218 programs that read their view heap add an index to the
heap's dword and make the high half with the carry of that sum read as
a number: s_add_u32 s40, s10, s18 then s_add_u32 s41, 0, src_scc. The
tracker took a carry into the high half only as s_addc_u32 x, 0, and
refused these as "an address with an untracked high half" (44 of the
second run's 200 captures).

s_add_u32 of x and src_scc is now x plus the carry, as s_addc_u32 x, 0
is (the same shortcut: offsets below 4 GB). A test tracks such a heap
address. Of the second run's 200 captures, 23 now reach a hardware
pipeline (5 before); the first run's 200 replay as before (88).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ted by

Once its sampler words are tracked, the second run's m083 gets as far as
writing its bitcode, and the writer stopped the emulator on it ("forward
reference outside a phi"): a lane-mask join takes a value computed in
one arm into a block that arm does not dominate. Read in a block laid
out after its definition, such a value would be written silently and
the driver given code that is not SSA.

The module now checks, before writing, that every value is read where
its block dominates the read (a phi's incoming value: where it
dominates the edge's predecessor), with dominators by Cooper, Harvey
and Kennedy over the reverse postorder write lays blocks out in. The
layout is a function of its own; written bytes are unchanged
(written_bytes_unchanged). A program that fails the check is refused
("a value used where it is not defined"), so lowering falls back as for
any other refusal; m083 now ends as "a first-lane read where not every
lane runs". A test covers a read in the other arm of a diamond, after
its join and through the wrong phi edge.

Both runs' 200 captures replay as before (23 and 88): none was written
with such a value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 0x218 programs make their immediate sampler with s_bfm_b64
s[44:45], 2, 54 (dword 1 = 3 << 22: MAX_LOD 12) and s_mov_b64
s[46:47], 0x18500000 (linear filters and mips). The tracker folded only
s_bfm_b32, so the sampler's first two dwords were untracked, looked
like an address, and the program was refused as "an address not from a
root parameter" (37 of the second run's 200 captures, 7 of the first
run's; the first refusal in game).

s_bfm_b64 of two constants is now ((1 << width) - 1) << shift, both
from bits 5:0, as the ISA defines it, split into its two dwords. A
tracking test covers the samplers' bitmask and one across both dwords;
an end-to-end test samples a 2 x 1 texture through such a sampler at
u = 1.0 and reads 1.5 on hardware and WARP (linear and wrapping; point
would give 1.0, clamping 2.0). Both fail without the fold.

No capture is refused as "an address not from a root parameter" any
more. Of the second run's 200 captures, 31 now reach a hardware
pipeline (23 before: m062, m074, m075, m076, m080, m082, m132, m135);
of the first run's, 94 (88 before: m088, m090, m163, m167, m170, m171).
None that passed is lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 22 dump-218 programs refused as "a structured buffer made raw, read by
index or format" all read the rewritten view with `tbuffer_load_format_xy
... offen format:[BUF_FMT_16_16_SNORM]` (m093 at 0x1e94, m027 at 0x271c,
...). An MTBUF load takes its format from the instruction and, without
idxen, its address from the byte offset alone: neither the cleared stride
nor the descriptor's format plays a part, so it reads what the load's raw
host view holds at that byte (`format_load`). Loads by index and
`buffer_load_format_*` (descriptor format) stay refused.

Tests: resource tracking of the typed read (and a refused
buffer_load_format_xy), and a_structured_buffer_made_raw_reads_typed_at_its_byte
on the card and WARP; both fail without the change.

Replay (programs reaching a hardware pipeline): dump-218 103 -> 103,
dump-218-run4 165 -> 165, none lost. The 22 programs now pass this point and
stop further on (descriptor data on lane-mask joins, descriptors changed
after loading, opaque lane masks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewDoing

Copy link
Copy Markdown

Independent check at 1be2ae5 of the stacked typed byte-offset load change: 39 synthetic structured-to-raw loads on each of physical RTX 5070 and verified WARP, using strides 4/8/16 and 13 DWORD offsets across bytes 0–124. All 78 actual dispatches returned both expected 16-bit SNORM components within one float ULP, including signed endpoints and nonzero second DWORDs in structured records. This targets the typed byte-offset load specifically; no title data or gameplay was used.

Verification was AI-assisted with GPT-6.2 Astra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants