Skip to content

Preserve opposite-row lane reads on Wave32 - #340

Closed
Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/wave32-opposite-row-permute
Closed

Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/wave32-opposite-row-permute

Conversation

@Kamiloj9

Copy link
Copy Markdown

Change

  • Lower the zero-selector form of v_permlanex16_b32 to an opposite-row lane read within each 32-lane half. Require full guest EXEC and proven lane participation before emitting the read.
  • Check the flags and source mask before simulating the operation in the existing whole-wave reduction path.
  • Cover the lowering and refusal cases on CPU, and read back all 64 lane results on Wave32 hardware.

Verification

  • The captured CS_WaterTransmittanceOpticalDepthProcessing compute shader emits WaveSize(32), passes the DXIL validator and creates a D3D12 compute PSO. The strict replay uses VICTORY_WAVE_LOCAL=idiom.
  • The synthetic GPU dispatch returned the expected values for all 64 lanes on an RTX 4080 SUPER.
  • The integrated diagnostic build created the compute PSO in the title and reached the first 3D scene. The run later hit the existing Windows commit exhaustion.
  • Targeted lowering and symbolic wave tests, Clippy, and the staged asset policy check passed.

SaymonMaster14 added a commit to SaymonMaster14/victory-fork that referenced this pull request Nov 25, 2026
… it refused 30 more compute shaders next to fxceless#134's v_permlanex16; lower/tests.rs stays

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@HAL9000RELOADED

Copy link
Copy Markdown

Merged on current main d510ee4 (+ #402 for SM 6.6 on Windows 10), RX 7900 XTX. The three new tests pass, and the hardware one fails without the fix. But main's emit::valu_tests::v_permlane16_and_x16_read_the_lanes_their_selectors_pick now fails, at translation:

lower: Unsupported { offset: 48, what: "unsupported opposite-row permutation controls" }

That test passes on main. It came in with 31714de, after this PR's base 2119b0e, along with main's general permlane lowering. The merge is textually clean, but the new opposite-row path now refuses controls that main translates. Since it fails at translation rather than on the GPU, it should fail on any host. Table of the run: #129 (#129 (comment)).

@Kamiloj9 Kamiloj9 closed this Nov 26, 2026
@Kamiloj9
Kamiloj9 deleted the codex/wave32-opposite-row-permute branch November 26, 2026 00:29
KomanderDG88 pushed a commit to KomanderDG88/VIniVIdiVIci that referenced this pull request Nov 26, 2026
…ast copied (VICTORY_WINDOW_SKIP_SAME, off by default)

A window outside buffers whose one buffer the CPU fills (in the PC's
memory, or in a GPU upload heap with VICTORY_WINDOW_UPLOAD=1) copies every
page the write watch or the guards name into its buffer whole. A page
written need not hold other bytes; nothing compared them. Measured in
AnyXboxX: 67-73 MB a frame of what such windows took were bytes they had
already taken.

Each such window now keeps a 64-bit print of the bytes it last copied for
each 4 KiB page (an XXH3-style accumulate of eight lanes; 8 bytes a page).
With VICTORY_WINDOW_SKIP_SAME=1 a page whose bytes give the same print is
not copied again: title memory is read 256 KiB at a time into memory of
the thread's, printed, and each run of other pages is stored. The buffer
still holds those bytes: nothing but the window's copies writes it; a
page copied only in part keeps no print; a window made again starts with
none; and a window that shaders are said to write (Shadow::writing)
compares nothing from then on. =sample copies as before and compares one
4 KiB page in 16, picked by its address, so the new frame line can say how
much of what the windows take is what they took last time. Unset or 0:
the code path as before, no work of it at all. The new line (with the
switch set) gives per frame what they took, copied and left out, and of
it the bytes that held what the window last copied, other bytes, nothing
to compare with, and the prints' memory.

Port: from LooperSalty/AnyXboxX PR fxceless#340 (in fxceless#358), commit
baedbeebbe037465e53bba5f340344fa5af03fb2 (the PR named the merge
3b6c3258). Applied by hand: AnyXboxX has transient windows
(VICTORY_CARD_WINDOW_UPLOAD, windowup.rs: a card side and no CPU side,
pages sent through pooled upload chunks), which this tree does not have.
Here it is for the windows with no card side, whose buffer is the one the
CPU fills (windows with a card side already compare against their CPU
side with VICTORY_COPY_CHANGED=1). The print, the page walk and the tests
are the original's, in a module of their own (windowskip.rs) rather than
in shadow.rs; the hook is Shadow::copy. The default is off, not the
original's sampling (=sample asks for it). The read-failure path: pages
are read with copy_mapped, which stores zeros for what cannot be read, as
the copy without the switch stores them, so a print is always that of the
buffer's bytes; the sample reads with read_into and takes a page not all
there as one taken in part. The shader-write guard is the copy's first
declared write (Shadow::writing) instead of transient_written. The ram
line's figure is on the new line. host.rs gains one line (the call).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants