Repository navigation
[BUNDLE] Ray tracing on 32-lane GPUs + 46 shader programs: #156, #213, #203 on main, verified together - #487
pepezin-ai wants to merge 6 commits into
Conversation
…ate on 32-lane GPUs Two gaps kept the ray-tracing programs off on a host whose waves are 32 lanes. 1. Buffer views picked from the view heap at a computed index. The shadow-ray trace programs read the address of their structure out of a heap descriptor they choose with a per-wave index, and walk the memory behind it. The translator could only take such an address from a fixed table position. The host now keeps, after the strides of `SLOT_STRIDES`, two more dwords per heap slot (low and high of the title address of the buffer view there), written where the strides are written, and the shader reads them by heap slot (`SLOT_ADDRESSES`). No new root parameter; the table grows from 8 MB to 24 MB per view heap. 2. `lane_uniform` proves three more things where no lane of a wave can part from the others: `tid >> 6` of the entry thread number (in a group whose x size is a multiple of 64) is the same in all lanes of a console wave; an `ds_read_b32` at such an address is; and a value joined by a phi, also at a loop header, is when its arguments are and every predecessor is entered by all the arriving lanes or none (a greatest fixed point over the loop's carried values and lane masks). The structure builder's block-scan programs fetch a wave-uniform running total with `v_readfirstlane` in such a loop; without the proof they asked for an exchange between the two host waves where not every lane runs. Effect, with `VICTORY_HOST_WAVE=32` on a 32-lane card: - 4 of the 5 shadow-ray trace programs (and their screen-space variants) now translate and validate; the adaptive one still stops at a lane mask read as data. - 52 of the 52 structure-builder programs now translate, validate and create a host pipeline (3 did not). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…16-bit wave sums with lanes gone
Three translator gaps that dropped world shaders (46 programs of the
retail pack; 0 that translated before stop now, by a whole-pack
`translate --validate --list` against the previous commit):
- A descriptor nothing uses as one, whose dwords the code reads all the
same ("a descriptor read only as data", 35, and one "a descriptor's
address or format read as data"): an 8-dword image picked from the heap
by an index in a constant buffer, its width/height/base level turned
into a texel size (PS_PuddleDetect, 34 pixel programs), or a 4-dword
buffer tested for being empty by its record count
(ShallowWaterSim:CS_MinTimestepReduce). New `unused_descriptor_kind`
gives such loads a kind (image: a 2D texture, documented as a shortcut;
buffer: a raw view) and `descriptor_data` rebuilds their size dwords from
the host view as it does for used descriptors; the buffer's address
dwords come from the host as before. Lane-copied descriptors and
samplers keep their own handling (checked first).
- The first half of an f16 interpolation pair whose register an f16 second
half then writes the high half of ("the first half of an
interpolation", 8, PS_DeferredTextured and mirror-reflection variants):
the second half keeps the low half of the register, which the first
half wrote and nothing reads. The first half of a pair now writes 0.
- A 16-bit float wave sum where some lanes have left the program ("a wave
sum of 16-bit floats where not every lane runs", 2,
compute_graph_ops:CS_TransposeVecMatMul*): on a host wave of 64 lanes,
`half_sum_present` follows the console's balanced tree, each lane
reading its partner run's partial sum from the first lane of that run
that is here (every lane of an aligned run holds the run's sum on the
console, the ones outside EXEC included), +0 where none is. Two host
waves of 32 still refuse it.
Tests: a GPU test of the 16-bit sum with 64, 63, 40, 33, 32, 17, 5 and 1
lanes staying, bit for bit against the console's tree (RX 7900 XT).
cargo test --workspace and clippy -D warnings pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The node test's reference (bvh.rs) and its emitter (emit/intersect.rs) took a child whose pointer is 0xffff_ffff for a hit whenever the ray entered its box. Its result dword was "none" either way, but sorted it came with a finite distance, so it could stand before a child that is there; a traversal that stops at the first "none" would then miss that child. Both now test the pointer too: a child that is not there is a miss, as the reference's description of the result already said. The box test's emitted code grows by two integer instructions per child (a compare and an and): the parity tests' program (the 64-bit form) goes from 519 to 527 instructions. The reference's new test is the reproducer of fxceless#173: a child that is not there whose box is entered first, one child behind it, and two that are not there with their boxes at the ray's origin, in both node widths. The card tests run the same node and ray. With the reference corrected and the emitter not, the four parity tests fail on the card; corrected, they pass on the card and on WARP. Not known: what the console returns for such a child, and whether the title's builder ever leaves a box under one. The cases of fxceless#173 are synthetic. docs/fork-ray-tracing.md lists it with the other assumptions. Reproducer and patch: @Bennet0k, fxceless#173. Co-Authored-By: GLM <noreply@z.ai>
# Conflicts: # crates/victory-shader/src/emit/mod.rs
|
Test report for this bundle's head Machine
Results
Run 1: first-chance exceptions in the title's own code just before the crash:
The title then ran its crash reporter; the layer blocked the upload. Four compute pipelines were refused by the driver with My guess: Run 2 (quarantine): the exceptions move to Run 3 (control): 0.3 to 2.9 fps. The slow frames (1–3.3 s) come from texture preparation when new areas load. Once a scene settles, frames take 345–475 ms at about 5,200 draws, of which roughly 300 ms is copying back and 120–240 ms is GPU time. Lighting on faces and skin in the cutscenes is clearly better than on Not tested
AI use
|
…ents HLE: read manifest fields past inline XML comments (cherry picked from commit 805317b)
|
Heads-up: as of fork I wanted to check it offline on an RTX 5070 (32-lane) against the title's shader pack. The interest is the five AI-assisted (Claude Code, Claude Opus 5.5). |
What
The three open PRs below, merged onto
main@ a803c87 and run together on a 32-lane NVIDIA card:VICTORY_HOST_WAVE=32)Each PR keeps its own commits and author; this branch only adds the merges.
Conflict resolved
#156 against current
mainconflicts in one place, thepub use shader::{...}list incrates/victory-shader/src/emit/mod.rs:mainaddedview_heap_limit, #156 addedSLOT_ADDRESSESandSLOT_STRIDES_DWORDS. The merge keeps all of them; nothing else in the file differs frommain.Verified
Windows 11, AMD Ryzen 7 5700X (8C/16T), 32 GB DDR4-3200, NVIDIA RTX 5070 12 GB, Series X profile, release build,
VICTORY_HOST_WAVE=32, AnyXboxX tuned settings (LATE_WAIT=3,WIDE_BACK=1,CARD_BUFFERS_MB=1024, loop limit 256).cargo build --release: ok.cargo test --workspace -- --test-threads=1: 506 passed, 0 failed. (With parallel test threads thevictory-gpulib tests once stopped with STATUS_ACCESS_VIOLATION; run one at a time, all 112 pass on this branch and on plainmain, so it looks like a race between tests rather than these PRs.)main@ a803c87 already carries a form of it.No game files, logs with paths, or personal data in this PR.