Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9886eb8
shader: lower s_not_b32, s_brev_b32 and s_bfe_i32 in the mesh frontend
mumba17 Dec 1, 2026
a6602c7
tests: pin SCC for s_brev_b32 and s_not_b32 in the mesh frontend
mumba17 Dec 1, 2026
31cc179
runtime: refresh large placed Mesh86 material SRVs
lambirou Dec 1, 2026
f711996
tooling: allow-list the placed material backing reason
lambirou Dec 1, 2026
020f90d
Merge origin/main e1161e43
lambirou Dec 1, 2026
fd9c6e8
shader: lower v_rcp_iflag_f32 and v_ashrrev_i32 in the mesh frontend
mumba17 Dec 1, 2026
95e4d36
tests: follow v_rcp_iflag_f32 to the exported position
mumba17 Dec 1, 2026
c3c3552
runtime: correlate slot 86 mesh drawings across record, close and submit
lambirou Dec 1, 2026
a59f4a5
tests: prove a Mesh86 draw through the target and the presented frame
lambirou Dec 1, 2026
b7d2a01
Merge remote-tracking branch 'origin/main' into codex/3641-mesh86-pre…
lambirou Dec 1, 2026
e325352
shader: lower v_cmpx_lg_f32, v_cmpx_gt_f32 and per-lane v_cmpx_gt_u32…
mumba17 Dec 1, 2026
715b84f
runtime: fail closed when a material backing was GPU-written before a…
lambirou Dec 1, 2026
dd7a038
tooling: publish pending slot 86 mesh requests
lambirou Dec 1, 2026
5625b20
shader: merge mesh writes under one CMPX inside a lane skip and resto…
mumba17 Dec 1, 2026
a7d9804
shader: keep a mesh lane limit across a nested CMPX skip that closes …
mumba17 Dec 1, 2026
c4ee8a1
shader: carry exact mesh lanes through nested CMPX skips to an EXEC r…
mumba17 Dec 1, 2026
8f769c7
shader, runtime: lower and bind mesh format loads from a descriptor-t…
mumba17 Dec 1, 2026
de321a3
shader: track lane-skip narrowing merges per register
mumba17 Dec 1, 2026
b445b8c
startup: refuse swizzled or thread-ID typed mesh86 V#s
mumba17 Dec 1, 2026
49ec291
build: build the mesh86_typed_vsharp checks in the pr preset
mumba17 Dec 1, 2026
7e997a3
shader: lower a mesh CMPX region inside a SAVEEXEC then arm
mumba17 Dec 1, 2026
d1c76a6
shader: let a mesh CMPX region run to the end of an if-only SAVEEXEC arm
mumba17 Dec 1, 2026
ad58312
shader: count a 32-bit SALU write in a mesh SAVEEXEC arm as one SGPR
mumba17 Dec 1, 2026
8e4a533
shader: track uniformity through component-wise float VALU ops
Holastor Dec 1, 2026
3e20366
shader: treat a mesh buffer load at a uniform address as uniform
mumba17 Dec 1, 2026
276ba83
shader: broadcast lane-0 value for full-EXEC mesh v_readfirstlane_b32…
timbot103 Dec 1, 2026
816ab82
shader: lower v_and_or_b32 and v_cvt_f16_f32 in the mesh frontend
lambirou Dec 1, 2026
39081ba
Merge remote-tracking branch 'fork/codex/3640-large-placed-srv' into …
lambirou Dec 1, 2026
f66eb91
Merge remote-tracking branch 'fork/codex/3641-mesh86-presentation-pro…
lambirou Dec 1, 2026
5f69ad3
Merge remote-tracking branch 'fork/codex/mesh86-profile-publish' into…
lambirou Dec 1, 2026
37b0439
tests: update float literal suffix to 1.0f/2.0f in readfirstlane_unif…
Holastor Dec 1, 2026
50ca55e
Merge branch 'pr-3729' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
41400e5
Merge branch 'pr-3770' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
90c7e04
Merge branch 'pr-3708' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
6092b14
Merge branch 'pr-3709' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
4f98a79
Merge branch 'pr-3790' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
559d307
Merge branch 'pr-3793' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
99b1d61
Merge branch 'pr-3789' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
b01355b
Merge branch 'pr-3765' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
3af555b
Merge branch 'pr-3782' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
8de9e26
Merge branch 'pr-3785' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
8283859
Merge branch 'pr-3760' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
3ccd58a
Merge branch 'pr-3743' into codex/m1-slot86-evidence
lambirou Dec 1, 2026
3028d43
mesh86: publish a PS-less mesh SRV table profile
lambirou Dec 2, 2026
de12a89
Merge branch 'codex/mesh86-psless-srv' into codex/m1-slot86-evidence
lambirou Dec 2, 2026
4178dcd
runtime: bind empty Mesh86 input views as zeros
lambirou Dec 2, 2026
fb392f1
test: print the nonzero Mesh86 input descriptor
lambirou Dec 2, 2026
3081d21
test: document the WARP mesh-device removal
lambirou Dec 2, 2026
59b68a2
docs: record the zero-record Mesh86 input view
lambirou Dec 2, 2026
acd0b64
runtime: fix Mesh86 fixture and non-native build
lambirou Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
"xmem_shim_test_controls", "startup_stub_xcrdapi", "startup_stub_xcrdapi_break_window_control",
"xmem_run_break_readers_check", "xmem_run_break_readers_control", "xmem_cross_call_merge_check",
"xmem_placeholder_split_check", "xmem_map_split_first_check", "startup_dstorage_break_window_check",
"xmem_page_runs_device_check", "linear_buffer_backing_check",
"xmem_page_runs_device_check", "linear_buffer_backing_check", "startup_mesh86_material_backing",
"bcpack_formats_check", "startup_stub_consumer", "startup_inline_retire", "startup_resource_retire_title", "startup_table_lock",
"native_compute_ir_dump", "native_pixel_ir_dump", "native_store_replay", "native_raw_buffer_view_check"
"native_compute_ir_dump", "native_pixel_ir_dump", "native_store_replay", "native_raw_buffer_view_check",
"mesh86_typed_vsharp_check", "mesh86_typed_vsharp_wide_format_mut", "mesh86_typed_vsharp_any_map_mut",
"mesh86_typed_vsharp_any_swizzle_mut", "mesh86_typed_vsharp_any_tid_mut"
]
},
{ "name": "release", "configurePreset": "release" },
Expand All @@ -50,7 +52,7 @@
"displayName": "Windows pull request smoke tests",
"filter": {
"include": {
"name": "^(bcpack_all_formats(_golden_control)?|startup_bcpack_storage|desktop_root_signature|era_heap_(allocation|failure)|xmem_shim_mapped_pages|cpu_aot_fuzz_smoke|cpu_archive_texture_gpu_warp|dual_uav_warp|spirv_.*_warp|static_exe_intake|descriptor_heap_paging(_swapped)?_warp|startup_launch|startup_mesh57_real_shape|startup_mesh57_runtime(_[a-z]+)?_warp|native_fixed_mesh57_published_pair(_refusal)?_warp|startup_tools_lint|startup_gfx2hlsl_cvt_off_f32_i4_controls|startup_gfx2hlsl_sad_hi_msad_controls|startup_indirect_(dispatch|count_split|draw(_indexed)?|mesh(_xmem_arguments(_skip_wait)?)?|counts_control)_warp|startup_indirect_(dispatch|constants|count)_inline_warp|startup_inline_retire_(on|control)_warp|startup_resource_retire_title_inline_warp_debug0|startup_table_lock_(control_)?warp|startup_indirect_mesh_lease_warp_dual(-trace(-disabled)?)?|startup_indirect_mesh_cache_heap(_wide)?_warp|runtime_mesh86_cache_cli_check|startup_shader_cache_key|startup_present_readback|startup_present_planes(_control)?|startup_present_composite_(warp|overlay_removed_control_warp)|startup_mesh_title_snapshot_warp|startup_list_copy_(warp|title_snapshot_warp|validation(_[a-z_]+_control)?)|xmem_(run_break_readers|cross_call_merge|placeholder_split|map_split_first)(_[a-z_]+)?|startup_dstorage_break_window(_[a-z_]+)?|xmem_page_runs_device(_join)?_warp|linear_buffer_backing_share_warp|startup_stage_package|startup_compute_packed_d16_x_uav_reference|native_.*_(ir|dxil|controls)|native_direct_mesh|startup_triage_run)$"
"name": "^(bcpack_all_formats(_golden_control)?|startup_bcpack_storage|desktop_root_signature|era_heap_(allocation|failure)|xmem_shim_mapped_pages|cpu_aot_fuzz_smoke|cpu_archive_texture_gpu_warp|dual_uav_warp|spirv_.*_warp|static_exe_intake|descriptor_heap_paging(_swapped)?_warp|startup_launch|startup_mesh57_real_shape|startup_mesh57_runtime(_[a-z]+)?_warp|native_fixed_mesh57_published_pair(_refusal)?_warp|startup_tools_lint|startup_gfx2hlsl_cvt_off_f32_i4_controls|startup_gfx2hlsl_sad_hi_msad_controls|startup_indirect_(dispatch|count_split|draw(_indexed)?|mesh(_xmem_arguments(_skip_wait)?)?|counts_control)_warp|startup_indirect_(dispatch|constants|count)_inline_warp|startup_inline_retire_(on|control)_warp|startup_resource_retire_title_inline_warp_debug0|startup_table_lock_(control_)?warp|startup_indirect_mesh_lease_warp_dual(-trace(-disabled)?)?|startup_indirect_mesh_cache_heap(_wide)?_warp|startup_mesh86_input_stream_(warp|hardware)|startup_mesh86_present_warp|runtime_mesh86_cache_cli_check|startup_mesh86_translate_warp|startup_shader_cache_key|startup_present_readback|startup_present_planes(_control)?|startup_present_composite_(warp|overlay_removed_control_warp)|startup_mesh_title_snapshot_warp|startup_list_copy_(warp|title_snapshot_warp|validation(_[a-z_]+_control)?)|xmem_(run_break_readers|cross_call_merge|placeholder_split|map_split_first)(_[a-z_]+)?|startup_dstorage_break_window(_[a-z_]+)?|xmem_page_runs_device(_join)?_warp|linear_buffer_backing_share_warp|startup_mesh86_material_backing(_mutant)?_warp|startup_stage_package|startup_compute_packed_d16_x_uav_reference|native_.*_(ir|dxil|controls)|native_direct_mesh|mesh86_typed_vsharp_[a-z_]+|startup_triage_run)$"
}
}
},
Expand Down
62 changes: 62 additions & 0 deletions docs/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10417,6 +10417,21 @@ python -B tools/startup/mesh86_cache.py <cache> <key> --mesh <desktop-ms.cso> --
ctest --preset release --no-tests=error -R '^startup_indirect_mesh_cache_' -V
```

The pending scan can perform the translation and the publication together. With
`X2W_MESH86_COMPILER` naming `compile_dxil.exe` and `X2W_MESH86_DXC` naming a
directory that holds `dxc.exe`, `dxcompiler.dll` and `dxil.dll`, `gfx2hlsl.py
--pending` (or `--watch`) translates `req_<key>.m86` with
`gfx1013-container-ms` or `gfx1013-container-ms-texture-heap` and
`req_<key>.ps86` with `gfx1013-mesh86-ps`, then publishes the pair through
`mesh86_cache.py`. A root without direct heap indexing uses the root-constants
proof; a resource-heap root uses the Texture1D map proof or a bounded
heap-buffer window derived from the desktop stages. A malformed request or a
failed proof writes `<key>.fail` and leaves no marker. `run.ps1 -Translate`
sets both variables from `compile_dxil.exe` and the build's recorded DXC
directory when they are present. `startup_mesh86_translate_{warp,hardware}`
checks the pending request, the published version 4 marker and the second run's
desktop PSO, with malformed-key and unproved-heap-root controls.

The executable subset uses the original root and PSO state. It accepts root
constants captured on the list, single-sample color attachments in exact format
order and a matching depth view when the stream declares one. A cached mesh
Expand Down Expand Up @@ -10525,6 +10540,26 @@ without the resource-heap flag is still refused. Such a wide root requires
`constants-only`: a marker published before the binding proof stays refused
until it is republished, while a root of constants only still accepts it.

The title's slot 86 `DispatchMesh` requests also arrive without a pixel stage.
`--prove-mesh-srv-table DXC --mesh-srv-plan PLAN` accepts a profile-6 marker
whose plan names each desktop `t0..tN-1` buffer SRV and the guest root
parameter and 32-byte table record (or root SRV) it came from. The publisher
dumps only the mesh stage, rejects a `createHandleFromHeap` read, requires the
desktop DXIL to bind exactly the planned byte SRVs, and refuses a plan entry
outside its root parameter. The runtime builds a synthetic root from the plan
and `bind_native_mesh86` resolves every record; an unusable record refuses the
draw. PS-full profiles keep their version-1/2/3/4/5 bytes.

On the 2026-12-01 slot 86 cache, 987 of 3,876 requests have an empty `.ps86`;
614 of those reached the heap proof and now publish profile 6 when their mesh
stage has no direct heap read (for example request `08dc8a7b1c8fd5da`, seven
SRVs and a mesh-only `b0` block). The source-built
`startup_mesh86_psless_{warp,hardware}` fixture publishes one root SRV, reads
`0x12345678` from it in the mesh stage and writes D16 depth 0.5. Hardware
passes; WARP currently removes the device after the recorded DispatchMesh
(`map argument readback failed (HRESULT 0x887a0005)`), so the WARP case is the
open blocker for this draft.

At each slot 61 `ExecuteIndirect`, the runtime reads the window's slots from
the title's bound shader-visible heap, the same 32-byte view tokens the slot 57
path reads. A slot that holds a registered typed buffer SRV over a complete
Expand Down Expand Up @@ -11247,6 +11282,33 @@ Run `python -B tests/startup_mesh86_srv_proof_check.py` to check the load count
without DXC. The synthetic DXIL dump passes with one DWORD load and is
rejected when a second identical load uses the same SRV handle.

The placed material-buffer backing has its own source-built fixture: one 64 KiB
placed buffer at an unaligned title address, two raw SRVs at different offsets,
a submitted GPU readback, a stale token, a UAV token and out-of-range records.
Run `ctest --preset release --no-tests=error -R
'^startup_mesh86_material_backing_(warp|hardware)$' --output-on-failure`; the
mutant entries keep the bytes visible at adoption and must fail. The fixture
reports refresh bytes (65,536 first, 4 per changed word) and the reused backing;
see [the mesh86 note](experiments/mesh86-pixel-execz.md#material-placed-buffer-backing).

A zero-record input buffer is an empty view, not a missing one. The prologue
request `062d66b9e013f28e` loads a raw V# from root parameter 1, descriptor
record 2 (SRV `t20 space1`), and that record is
`00013920,00000000,00000000,00000000`: a nonzero base with no records. The
captured mesh stage has an empty input signature and reads the V# on one branch,
so the hardware returns zero for every load. The Mesh86 input path now binds a
16-byte zero view for that state and logs the guest table, record and descriptor
once; the ordinary compute input path still refuses zero records. The
source-built check publishes a PS-less mesh profile with an 8-byte
descriptor-table SRV, writes a raw V#, and expects depth 0.5 for a nonzero
record, depth 1.0 for a zero-record view and the named
`an input is in title memory outside any placed buffer` refusal for an
unmapped base. Run
`ctest --preset release --no-tests=error -R '^startup_mesh86_input_stream_(warp|hardware)$' --output-on-failure`.
The RX 9060 XT case passes; WARP returns 77 when the dispatch removes the WARP
device with `0x887a0005`, the same removal the existing
`startup_mesh86_psless_warp` fixture reports.

On the Release worktree at `76aeef7f` plus these changes, the combined lease,
SRV proof, export and mapped-page selection passed eight tests. The two mesh
cases returned 77 on the adapters listed above. `dumpbin /exports` showed
Expand Down
83 changes: 80 additions & 3 deletions docs/experiments/mesh86-pixel-execz.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,85 @@ resource. Verified GPU-backed views can span more than 16 MiB up to the
desktop raw SRV limit.

A local runtime sample created and selected four desktop Mesh PSOs and
observed their direct dispatch calls. All sampled scene dispatches stopped at
resource binding. One needed a 128-byte root SRV with no mapped backing. The
other three needed a large placed buffer view whose desktop backing did not
observed their direct dispatch calls. At the time of that sample, all scene
dispatches stopped at resource binding. One needed a 128-byte root SRV with no
mapped backing. The other three needed a large placed buffer view whose desktop
backing did not
alias the guest memory or have a verified GPU producer. Visible scene output
remains unverified.

## Material placed-buffer backing

A native Mesh86 material SRV on a placed buffer whose desktop backing does not
alias title memory no longer stops the bind. The material path adopts the
existing committed desktop resource through the linear-buffer refresh path
(`linear_buffer_backing.h`): the first submission before a consumer copies the
title range, later submissions compare 4 KiB blocks and copy contiguous changed
runs (runs separated by at most one block are merged; more than 1024 runs fall
back to one span). The consumer queue waits for the refresh fence, and a refresh
waits for earlier tracked submissions. The placed backing is reused, so adoption
adds no default-heap VRAM. A submitted copy or bound UAV makes the
desktop bytes authoritative and stops the refreshes.

The source-built fixture places a 64 KiB buffer at an unaligned title address,
so slot 133 keeps a committed default backing. Two raw SRVs at offsets 0 and
`0x8000` are read by one compute dispatch; the readback distinguishes the two
values. Changing one title word changes only that SRV's value, and the refresh
copies four bytes; two disjoint changed words copy two four-byte runs. Sentinels
outside the placed range stay unchanged. The controls refuse an out-of-range
record, a record over the raw-SRV limit, a UAV view token and a released
resource. The fixture reports one adopted backing and no linear placement.

```powershell
ctest --preset release --no-tests=error -R '^startup_mesh86_material_backing_(warp|hardware)$' --output-on-failure
ctest --preset release --no-tests=error -R '^startup_mesh86_material_backing_mutant_(warp|hardware)$' --output-on-failure
ctest --preset release --no-tests=error -R '^startup_mesh86_material_backing_provenance_(warp|hardware)$' --output-on-failure
```

The mutant keeps the bytes visible at adoption; both normal tests must pass and
both mutant tests must fail (the CTest entries use `WILL_FAIL`).

A GPU write submitted before the first material bind is remembered by
`note_gpu_write` even when linear-buffer tracking is off; adoption then fails
closed with the named refusal instead of refreshing the GPU bytes from stale
title memory. The provenance control seeds a GPU copy while tracking is off,
resolves the first material view (refused) and verifies the GPU bytes survive.
A write performed outside the shim, for example through a desktop list that
bypasses the copy slots, is still not visible. The changed-run comparison runs at each submit
over the whole resource and the first refresh copies it whole, so a 174 MiB
resource still costs a 174 MiB compare per submission even when few bytes
changed. The fixture measures refresh bytes and the reused backing; it does not
measure frame time or peak VRAM against the DXGI budget on a title scene.
## Presented-frame proof (#3641)

`tests/startup_mesh86_present_check.py` publishes the constants-only pair of
`tests/startup_indirect_mesh.hlsl`, then records one slot 86 DispatchMesh with
groups (1,1,1) into a 4x2 RGBA8 target with three attachments. It reads the
target back before composition, composites the target as plane 0 with the
window's selection (`composite_steps`) and compositor (`PlaneCompositor`), and
reads the presented plane back. The same frame without its ExecuteIndirect
call must leave both frames at the clear colour.

The fixture also records the sampled draw's root SRV shape (a 128-byte window
with no mapped backing). The published constants-only profile refuses that
root before any record or submission, so the first refusal is reported apart
from the colour evidence. The target and presented readbacks live in the
fixture; the runtime adds no readback, allocation or CPU wait to the normal
rendering path.

`X2W_MESH86_PRESENT_TRACE=1` (also `X2W_D3D12_TRACE_DIRECT_MESH=1`) adds at
most 48 rows per stage and prints the record, close and submit stages of one
recording:

```text
x2w-mesh86-present record list=... recording=... guest_pso=... pso=... mesh86=... groups=1,1,1 groups_known=1 root=... targets=3 format=28
```

The close and submit rows repeat the list pointer and recording ID. The record
row reads the group counts from the title's argument record. Without the
switch the runtime takes one cached environment check per recorded mesh draw
and prints nothing.

```powershell
ctest --preset release --no-tests=error -j1 -R '^startup_mesh86_present_(warp|hardware)$' --output-on-failure
```
54 changes: 54 additions & 0 deletions docs/experiments/native-mesh-vector-alu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Mesh frontend vector bit-select and binary16 narrowing

The direct C++ mesh frontend behind `gfx1013-raw-ms` now lowers two more forms
that the forced slot 86 mesh path refused. After the scalar bit operations, the census of the
2 873 title requests ordered the next refusals `v_cvt_f16_f32` (357) and
`v_and_or_b32` (331), followed by the control-flow, heap-provenance and pixel
blocks.

## Lowering

Both names join the vector list in
[gfx1013_direct_mesh.inl](../../src/gfx1013_direct_mesh.inl) that already handles
`v_or3_b32`, `v_add3_u32` and the other three-source forms, so they share
`arithmetic()` with the compute frontend.

- `v_and_or_b32` (VOP3 `0x371`) takes its arity of three from the
`alu_rules` entry and lowers to `(S0 & S1) | S2`. The shared operand gate
still refuses `abs`, `neg`, `clamp` and `omod`.
- `v_cvt_f16_f32` (VOP1 `0x0A`) narrows S0 with the same integer
round-to-nearest-even conversion the compute frontend uses, so desktop
conversion and denormal handling cannot change the encoding: the sign comes
from bit 31, binary32 subnormals become signed zeros, a binary16 subnormal is
kept, the 65520 tie and everything above it give `0x7c00`, and a NaN keeps
its quiet bit (`0x7e00`). The low half of the destination receives the
encoding and the high half keeps the reaching destination value, as the
compute frontend and the RDNA 2 high-half-preservation rule do. Because the
merged word reads the destination, an unproven destination still refuses
(`unproven mesh entry register`); the conversion is not treated as a
uniform result for `v_readfirstlane`.

## Observed IR

With `s20 = 0x0000ffff` and `s21 = 0x00ff0000`, the source-built
`v_and_or_b32 v1, v0, s20, s21` emits `and i32 %v0, 65535` then
`or i32 %and, 16711680`, and POS0.x exports that word.

`v_cvt_f16_f32 v1, v3` with v3 holding 1.0f, 0.0f or -2.0f emits
`lshr i32 <bits>, 16` with `and ... 32768` for the sign,
`and i32 <bits>, 2147483647`, `lshr ... 23` and `and ... 8388607` for the
magnitude, exponent and fraction, the nearest-even narrowing with
`icmp ugt i32 %exp, 142` giving `31744`, `icmp ugt i32 %mag, 2139095040`
selecting `32256` plus the quiet bits, then `or i32 %narrow, %sign`,
`and i32 %destination, -65536` and the final `or`. POS0.x exports the whole
word.

## Controls

An unbound third source keeps `unbound numeric SGPR s24`. A conversion from an
unproven VGPR 24 or into an unproven VGPR 5 keeps `unproven mesh entry
register`.

**Reproduce** with
`ctest --preset release --no-tests=error -R '^native_direct'`.

Loading