Shorten guest-memory descriptor selection for shader writes #232

Manually merged
github merged 3 commits from github-bot/gh-232 into main 2026-12-03 17:29:33 +00:00 AGit
Owner

@⁠tommiehansen on GitHub · 2026-12-02 19:54 UTC · original
tommiehansen:perf/guest-address-lowering → main · +40 −8 · 3 files · 3 commits · merged 2026-12-03 17:22 UTC

Change

Guest-address writes use a simpler descriptor selection. An empty directory word identifies a missing page. A signed maximum with zero selects the null UAV for a read-only page. The shader still masks the read-only bit on the read path. Address lookup, fault recording, and memory ordering stay the same.

This removes the read mask from the write path and shortens the integer dependency chain. BVH builder writes and other by-address stores can benefit. The effect on backend ISA and frame time is unmeasured.

Comparison

Directory entry Shader write destination
Missing Null UAV
Read-only Null UAV
Writable Original writable descriptor

The new selection removes the read mask from the write path while preserving these outcomes. The standalone directory test covers all 8,191 stated cases; final ISA and GPU-time savings remain unmeasured.

Validation

  • The standalone directory test covered all 4,095 writable and 4,095 read-only slots plus the empty entry.
  • Portable shader tests passed. Windows-target standard and diagnostics type checking passed on the integrated checkout.
  • Hardware benchmarking was unavailable.

Please compare shader ISA, BVH build time, image parity, and frame-time tails with ray tracing at native 1080p on both the RX 9060 XT 16 GB and RX 9070 XT under Linux.

**@⁠tommiehansen** on GitHub · 2026-12-02 19:54 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/232) `tommiehansen:perf/guest-address-lowering` → `main` · +40 −8 · 3 files · 3 commits · merged 2026-12-03 17:22 UTC ## Change Guest-address writes use a simpler descriptor selection. An empty directory word identifies a missing page. A signed maximum with zero selects the null UAV for a read-only page. The shader still masks the read-only bit on the read path. Address lookup, fault recording, and memory ordering stay the same. This removes the read mask from the write path and shortens the integer dependency chain. BVH builder writes and other by-address stores can benefit. The effect on backend ISA and frame time is unmeasured. ## Comparison | Directory entry | Shader write destination | |---|---| | Missing | Null UAV | | Read-only | Null UAV | | Writable | Original writable descriptor | The new selection removes the read mask from the write path while preserving these outcomes. The standalone directory test covers all 8,191 stated cases; final ISA and GPU-time savings remain unmeasured. ## Validation - The standalone directory test covered all 4,095 writable and 4,095 read-only slots plus the empty entry. - Portable shader tests passed. Windows-target standard and diagnostics type checking passed on the integrated checkout. - Hardware benchmarking was unavailable. Please compare shader ISA, BVH build time, image parity, and frame-time tails with ray tracing at native 1080p on both the RX 9060 XT 16 GB and RX 9070 XT under Linux.
The address translator masks the directory entry before checking
presence, then tests the sign and selects a null slot for writes.
The read-only flag always accompanies a nonzero slot, so an empty
entry can be recognized directly. Use a signed maximum with zero
for writes and keep the mask only on the read path.

This reduces work and avoids keeping both forms live across the
fault branch on the write path. Preserve the fault buffer slot,
guards, null view, descriptor ordering and coherent access flags.
Assert the host encoding used by the shader and bump its cache key.

The directory test covered every writable and read-only slot, plus
the empty entry. Portable tests and Windows-target checking passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 19:57:23 +00:00
The upstream merge retained both declarations and prevents the shader crate from compiling. Preserve guest-address lowering under its dedicated cache version.

Passed 282 portable shader tests and the diagnostics Windows-target check. Hardware benchmarking was unavailable.
github manually merged commit 7c37d159af into main 2026-12-03 17:29:33 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.