Repository navigation
Conversation
|
Tested
No game data used. |
|
Pushed one more commit ( Fixed: a16 does not make derivatives 16-bit. The decoder (already on i.e. four 32-bit derivatives plus the packed coordinates (and clamp). The decoder test now checks 5, 6, 3 and 7 address dwords for Settled: the a16 bias. Settled: partial stores. RDNA 2 ISA, MIMG Still open: whether the texel offset applies before the address mode. |
… its derivatives) into the integration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
|
A limit of this PR, confirmed by a probe while reviewing the other image PRs with the same scrutiny (RTX 5070): the fallback for texel offsets that are not immediates (past -8..7, or per lane) shifts the coordinates by offset / size of the level the instruction asks for. If the sampler's own LOD range moves the sampled level (probe: requested level 0, sampler MinLOD 1, x offset +1), the immediate form reads x = 1 at level 1 and the shifted form reads x = 0. The code comment already says this case differs; it is silent, not refused, so it belongs here too. An exact form would need the level the sampler actually uses, which the shader cannot know; refusing non-immediate offsets unless the sampler is known not to clamp the level is the conservative alternative if anyone sees it matter in the title. From synthetic probes only; I have no copy of the title. |
|
Follow-up on the 25 #138 handles exactly this (a cube's gradients are its two face coordinates'). #318 ( AI-assisted. |
A cube's derivatives are those of its two face coordinates: two per direction, then s, t and the face (and the clamp), eight address dwords for image_sample_d_cl. The lowering took three per direction as for a 3-D image, ran past the instruction's addresses and refused the program with "an image address" (and refused cube gradients by name after that). The face coordinates' derivatives become the direction's for DXIL's SampleGrad: cube_direction is linear in s and t on a face (u = 2s - 3, v = 2t - 3), so the direction's derivative is the same per-face table with 2 ds for u, 2 dt for v and 0 for the constant axis. image_sample_d, _d_cl, _cd and their _g16 forms now lower on cubes; texel coordinates, level queries and texel offsets on cubes stay refused. Reported from the title by a tester on PR Marvisak#160: every image_sample_d_cl in the 25 programs that stopped at "an image address" is on a cube, with eight address dwords and no a16. Test (RTX 5070): a cube whose every face and level holds its own value, sampled at each face's centre with derivatives of 1, 2 and 4 texels along s or along t, with and without a clamp: the texel read names the face and the level. Without the change the programs stop at "an image address"; with the direction's derivative scaled by 1 instead of 2 they read one level too fine. The test host gains a cube view with mip levels. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@EduAzevedo thank you, that is exactly the information this PR was missing, and it reproduces here: a hand-assembled Fixed in Test on an RTX 5070: a cube whose every face and level holds its own value, sampled at each face's centre with derivatives of 1, 2 and 4 texels along s or along t, with and without a clamp; the texel read names the face and the level. With the scale wrong (1 instead of 2) it reads one level too fine, so the test does check the mapping, at face centres. If you can rerun on
On #138: its cube rule is the same idea. The difference between the two PRs is the a16 layout (#138 packs derivatives under a16, which LLVM's No game data used on my side. |
Reran on Vertex and pixel programs emitted: 12,284 → 12,357 (12,332 on
Everything else versus |
image_gather4_l and _l_o lowered only when the level was a known 0, since DXIL's gathers read level 0. A tester's run over the title's shaders (PR Marvisak#160) found all 12 programs with image_gather4_l stop there: none has a level the translator can prove is 0. Such a gather is now four samples: the footprint's four texels, in the gather's order, each sampled at its centre at that level. At a texel's centre every filter returns that texel, and the sampler applies its own address mode and level range, as it does for the console's gather. The footprint is floor(u * size - 0.5) and the next texel in each direction, moved by the texel offsets (any offsets, per lane too), on the level rounded to the nearest whole one and clamped to the view's levels. Marked as a shortcut: a sampler whose LOD bias or range moves the sampled level off that one reads another grid. A gather at a level known to be 0 stays a real gather. Comparison gathers (the function is in the sampler) and cube gathers at an unknown level stay refused. Test (RTX 5070): on a mipmapped texture whose texels name themselves, lanes gather at levels 0, 1 and 2 passed per lane, with and without per-lane offsets past -8..7, through a clamp sampler and a wrap sampler; each lane's four values are the footprint's, clamped or wrapped. With the gather order permuted the test fails. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@EduAzevedo thank you, this is the first measurement of this PR on the title's shaders, and "nothing that translated on The 12 Test on an RTX 5070: a mipmapped texture whose texels name themselves; lanes gather at levels 0, 1 and 2 passed per lane, with and without per-lane offsets, through a clamp and a wrap sampler; each lane's four values are that level's footprint. One The rest of your numbers, as I read them:
If you rerun on No game data used on my side. |
Reran on
A correction to my two earlier comments: my Cube vs. cube array: not done yet; it needs a game run with a small local logging change, so I'll only do it if you think it is worth it. |
|
@EduAzevedo thank you for the rerun and for the correction; I have put your numbers, with the correction applied, into the PR description under "Measured on the title's shaders" and credited them to you. Tell me if I have misread anything: 12,284 to 12,357 vertex and pixel programs, the 12 gather programs translating, 23 of 27 cube Cube vs. cube array: not worth a run on its own. If you (or anyone) are logging bound views in a world run for another reason, the dimension of the views these 23 programs sample would settle it; until then the description says it is unmeasured. The 4 left at |
Yes, that's all correct against the rebuilt main |
|
Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head
|
The tester tree (upstream main ffe310e plus its PRs, update 8; see its INTEGRATION.md) ran 11-25 minutes in the world on an RTX 5070 without a device removal. Where both sides carry the same PR (the wave64 stack #223/#233/#320 with #439 and #180, #454, #336, #259, #331 and others), the tester tree's newer head is taken; our own work and the PRs only we merged are kept. Conflicts, file by file: - descriptor/host.rs: the tester layout (`spare`, the guard slot after the dynamic slots, `free_table`, the capped sampler heap). A capped view heap keeps `capped_reserve()` dynamic slots, now 2^18 by default (the tester measurement, and our 91fed158), still `VICTORY_DYNAMIC_SLOTS` in diagnostics builds; uncapped hosts keep our 2^19. Our slot statistics (TAKEN/PEAK/SHORT), the bindless plan cache (`CommittedRegions`, `timed_valid_title_address`, `timed_find`, `title_bounds`) and the revision triple are kept beside the tester's `guard_slot`. - Buffer states: the tester tree's buffer-state tracker (#334: every list moves host copies of title memory between GENERIC_READ and UNORDERED_ACCESS and back to common before it closes) and depth twins (#469) are taken. #40's enhanced/legacy indirect barriers (the indirect prelude, `use_indirect_buffers`, the title buffer handoff mirrored in `host_barrier`) cannot share buffers with that tracker and are dropped; #40's argument checks (`byte_len`, exact spans, overflow-safe clamp shader, aligned counts) stay. `indirect::bound` and #282's `rectangles` go through `buffer_state`, and `indirect::execute` (#334) replaces `done`. #178's DXC fallback compiles both of our passes. Our segments (#387: `close` ends the segment, `close_native` closes a native list) carry the tracker: each native list returns its buffers to common and its twins to their depth targets, and each prelude also holds our texture uploads. - shadow.rs: our write flow (`queue_write`, one `snapshot` after the batch's refreshes, `finish_writes`, the unchanged-page cache) with #261's copy-back that also gives the snapshot the title's bytes; its tests run through our flow. - pipeline/make.rs: #275's per-frame budget and per-pipeline wake pair, with our compute waits (a dispatch waits for its pipeline, up to 20 s). - pipeline/library.rs: the tester version (#347, #275's saver thread); our concurrent-write test kept. shader_cache.rs: our byte-returning cache API with #358's "translated, only not kept". - draw.rs: #493's root SRV tables; where no table can stand in, our drop of a draw whose root view is unset or outside title buffers. Our refusal of a table offset past the capped heap stays. - resource.rs: `HostTexture` has both our `staged` generation and the depth twin. - Shaders: the tester's lower.rs for the wave64 stack, #160's image sampling (it covers our #73 and #136 sample forms) and #453/#587; kept from our side: #136's preference for an image or buffer use of a descriptor read as data and its `s_buffer_` arm, #422's nearest-even narrowing (also for #169's d16 loads and #453's interpolation), #452's spin-wait limit, #391's LDS limit, #302's spilled root arguments (now in `NativeProgram::translation_ir`), #136's PSV0 interpolation beside the tester's row harmonisation. split_tests.rs, lane_read_loop_tests.rs and docs/wave64-on-wave32.md are the tester versions (the same PRs at newer heads). - Tests: #483's heap guard dwords filled in our GPU tests of #200 (v_div_scale) and #437 (scalar loads from a raw view), which read through the guard slot otherwise; #334's debug-layer test passes an offset to our `indirect::bound`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two testers bisected #136 as making every frame black on RTX 5080 and 4080, loading screens included (upstream issue #71); the tester tree leaves it out. A plain revert of 5254cfa conflicts with #160, #437 and the tester merge, so each of #136's constructs is set to the tester tree's form: - s_load through a tracked descriptor: SRV only, as before #136 (no UAV raw reads); #437's byte offsets and its test stay. - A descriptor read as data: the first use found, not #136's preference for an image or vector buffer use; #136's s_buffer_ arm is gone. - PSV0 interpolation modes (psv_interp) are no longer read; the conservative-depth centroid and the row harmonisation stay (tester). - calculateLOD passes cs[0..2] as the tester tree does. - Dead descriptor dwords at data joins: the tester's undef arm (descriptor_dword) only, not #136's zero for has_data joins. Kept because the tester tree has the same form: the signature sort by row, barycentrics (23 => 28), the comparison-sample check, and #160's gather and a16 sampling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Image samples and gathers now lower by their form (comparison, derivatives, coarse or 16-bit derivatives, level, level 0, bias, level clamp, texel offset) instead of a fixed list of opcodes. The address dwords follow LLVM's ImageDimIntrinsics and Mesa's ac_build_image_opcode: offset, bias and reference a dword each, then the derivatives (16-bit ones two per dword in the _g16 opcodes, each direction its own), the coordinates and the level or clamp (a16 packs those, not the derivatives). The decoder counted 32-bit derivatives for the _g16 forms and took a16 to pack the derivatives; it now sizes them by the opcode. Newly lowered: - every texel-offset form; DXIL immediates when the offset word is a constant in -8..7, else (past -8..7, or per lane) the coordinates move by offset / size at a level known at translation; - _cl (the DXIL clamp argument), _cd (as _d), _g16; - image_sample_c, _c_cl and their _o forms in compute as well as pixel shaders; image_sample_c_l(_o) at level 0, image_sample_c_b(_cl)(_o) with a bias known to be 0; - image_gather4_l(_o) (at a level known to be 0 a gather, at a level known only at run time four samples of the footprint's texels at their centres), image_gather4_c_lz(_o), image_gather4_c_l(_o) at level 0 (textureGatherCmp); - cube samples with gradients (image_sample_d, _d_cl, _cd and the _g16 forms): a cube's derivatives are those of its two face coordinates, which become the direction's through the face's linear part of cube_direction; - a16 biased samples and a16 comparisons; - image_store of some channels: the data VGPRs are the dmask's channels, the others are written as 0. Still refused, each with its reason: gathers at an implicit level or with a bias, comparisons with derivatives, at a level or with a bias not known to be 0 (SM 6.7/6.8 operations), offsets past -8..7 or per lane at a level not known at translation, comparison and cube gathers at a level not known to be 0. XTP adaptation: emit/lower/image.rs (S0b) takes the PR's image function as is (XTP's equalled upstream ffe310e, the PR's base) with the 64-bit atomic branch of the #539 port put back; `Module::known` (bitcode.rs) is not taken, the existing `int_value` reads the constants (XTP holds every register dword as an i32). The test host gains textures with mip levels, cube textures with mip levels and R32F textures (emit/host.rs); the decoder fix and its test are in gfx10. emit/image_tests.rs takes the PR's tests; the #539 port's atomic tests become its module `atomic64` and now take the GPU one at a time with the others (the PR's last commit: XTP's VALU tests already share that lock). Review notes, kept as shortcuts in the code: the four-sample gather at a run-time level reads the footprint of the level rounded to the nearest and clamped (a sampler bias or range that moves the level reads another grid); offsets emulated by moving coordinates assume the sampler keeps that level; partial stores write 0 to the channels the dmask leaves out (the PR's model, checked on the host, not on the console). Comparison samples with implicit derivatives in compute are sampleCmp, which validator 1.6 refuses there and the drivers run (the test lets that error through). Survey (shaders.rpf, any host, every translation validated): 23,387 -> 23,472 translated, 85 new: 44 a16 biased samples, 25 image_sample_d_cl (all on cubes: #563's 25), 16 image_gather4_l (at a run-time level); 77 accepted by dxil.dll, 8 stop at "Container part 'Program Input Signature' does not match", a class the pack had before (15 programs). None lost, no translation that existed changed. 68 programs past these blockers stop at the next one (48 scalar memory read as data). This covers Marvisak/VIctory#563 (head 10ac6ceac9284caa6dd5d4bad3166687f8d0c1ac) by SAitken91: the same cube gradients (the same table) and image_sample_d_cl, written independently; the PR's own commit 2cf3ccd says the 25 programs are the title's. Nothing of #563 is left to port after this. Ported from Marvisak/VIctory#160 (head 5ce85c5e70878e9208a1cc02c2b65966a1316653) by r4tedx Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Saitken91 <98485913+SAitken91@users.noreply.github.com>
|
Tested this PR (
Nothing else changed. On this build there are 16
In the title (one run each, Series X mode,
Caveat: one run each, and the PR run had a warm pipeline library, so the timing and the missing hang are not conclusive. Happy to run more passes or a diag build with |
|
@adnanoos thank you. This adds the one thing the earlier counts did not have, host pipelines, and it corrects a number: your run finds 16 On those 6: I read them as you do. The translation is accepted by the validator and refused at pipeline creation, like the roughly 320 compute pipelines On the title runs: agreed that one run each with a warm pipeline library does not establish the missing hang, and you say so yourself. No need for more passes on this PR's account. If you do run again, the comparison worth having is both builds on a cold cache. @Yaekai thank you as well for the run on the RTX 3070, here and on #265. The title was not used in my tests. AI-assisted. |
|
Checked the saved One limit: the listing records only the HRESULT text, not the driver's reason, so this shows the same error code rather than the same cause. If it would help, I can rerun those 6 with the debug layer on and post the messages next to a few of the 320. On the title: noted. If I run it again, it will be both builds on a cold cache. |
The two reference draws create a host and draw on the hardware adapter and WARP without `valu_tests::ONE_AT_A_TIME`, so on CI's WARP adapter they could dispatch at the same time as the other GPU tests; the run on 6ddbdfc ended with the victory-shader test process dying with STATUS_ACCESS_VIOLATION and no failing test named, the crash seen before on Marvisak#704, Marvisak#160 and Marvisak#265 for that reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@adnanoos thank you, that settles it as far as a listing can: the same text for the 6 as for the 320, and a set difference of exactly those 6. The description already says they are refused the way On your offer: the debug-layer messages for those 6 next to a few of the 320 would be useful, but for the issue that tracks those refusals (#71's class) rather than for this PR, which only moves the 6 from "refused by the translator" to "refused by the driver". If you do run it, that is where I would post it. AI-assisted. |
|
In-world evidence for the explicit-level gathers here, from a fork that runs The fork found that a host gather (DXIL op 73, no level) reading level 0 where the title names one broke the title's meshlet occlusion culling. The culling gathers a 4×4 block of the depth pyramid at a named level: one That is what AI-assisted (Claude Code). |
…sak#704 + Marvisak#1511 Conflicts in crates/victory-shader/src/emit/lower.rs, resolved by hand: 1. descriptor_data: the bundle (Marvisak#953 s_buffer_load uses, Marvisak#1067 "read only as data" from the table's range) and Marvisak#180 (twin loads of the same dwords) both rewrote how the view's kind is found. Kept Marvisak#180's lookup (own uses, else a twin load's) and the bundle's handling of the use and of the unused case, plus the one case Marvisak#180 accepted that the bundle did not: an 8-dword load outside a table/heap range, taken as a 2D image (Marvisak#180's "image the program only measures"). Where both accepted a descriptor they built the same view. 2. phi joins: the bundle's arm (Marvisak#1073, a mask dword joined by ballot) and Marvisak#180's arm (a descriptor dword at a data join is undef) were inserted at the same place. Both kept, bundle first; the first needs a tracked lane mask, which a descriptor dword is not, so they do not overlap. 3. No textual conflict, did not compile: the bundle (Marvisak#306) gave `addr_val` a start position (`addr_val(l, start, k)`); Marvisak#180's compute image_sample_b arm read the bias with the old form at dword 0 through `as_float`. It now reads it as the bundle's sampleBias does: after the offset word when there is one, an f16 with a16 (`to_float`). This is the bias half of the Marvisak#160/Marvisak#180 interaction described in Marvisak#160 (comment) , which the bundle's offset forms already expose.
…ge samples) onto Marvisak#309 + Marvisak#180 + Marvisak#704 + Marvisak#1511 PR Marvisak#160 head 5ce85c5, merged onto integ/next-v3 (0bb7335). The bundle (Marvisak#1511) already carries Marvisak#306 (a16 bias as f16, a16 derivatives 32-bit), 10ac6ce (cube gradient samples, image_sample_d_cl) and cbc8c33 (image_get_lod on cubes); Marvisak#180 adds compute image_sample/_b as sampleGrad with quad gradients. Where Marvisak#160 and the bundle implement the same thing, they read the same address layout: offset, bias and reference a full dword each (a16 bias an f16 in the low half), derivatives 32-bit unless _g16, a16 packing only coordinates and level or clamp. The bundle's Marvisak#306 layout is kept as the base and Marvisak#160's forms are added to it. gfx10/fields.rs (image_addr_dwords): both sides size derivatives by _g16 and pack only coordinates and levels with a16. Kept the bundle's Marvisak#306 version (a g16 token rather than Marvisak#160's ends_with("_g16"), which gives the same count for every opcode name) together with its a16_keeps_derivatives_32bit_outside_g16 test. emit/host.rs (1 hunk): Marvisak#160 adds a test-host arm for Levels/CubeLevels/Depth SRVs; the bundle (Marvisak#704) extended the UAV arm to BufferUav with a stride column. Both arms kept: Marvisak#160's arm first, then the bundle's UAV arm unchanged. emit/lower.rs: 1. Free functions after half_outputs: the bundle added half_inputs and Marvisak#160 added SampleForm/sample_form/GATHER_AT_LEVEL in the same place. Kept both. 2. Opcode match: the bundle added "image_sample_d" | "image_sample_d_cl" to the fixed list, and Marvisak#160 replaced the list with the parsed form (_ if form.is_some()). Took Marvisak#160's. d_cl is the form {d, cl}, so it still lowers to SampleGrad with its clamp. 3-4. Address layout: the bundle had (Marvisak#306) first = offset + bias + cmp full dwords, 32-bit derivatives (2 per direction on a cube, 10ac6ce), and `at` = first + grads, from which the a16-packed coordinates and level start. Marvisak#160 had the same layout as whole/per_direction/first, plus _g16 derivatives and _cl. Kept the bundle's names and layout (first, graded, at, addr_dword) and put Marvisak#160's pieces on them: first is now o + b + c from the form (it was offset_word + (name == image_sample_b) + cmp); per_direction halves the derivative dwords for _g16 only; grad_at, coord_at, bias_at, float and known (Marvisak#160) read through the bundle's addr_dword in place of Marvisak#160's duplicate `raw`. Marvisak#306's to_float/addr_val pair for coordinates and Marvisak#160's float(coord_at(k)) compute the same thing; the latter is kept because the level, clamp and known checks use it. The a16 refusal of comparisons in the bundle's code is dropped, as in Marvisak#160 (the reference is a full dword). Also, without a textual conflict: Marvisak#160 refused level queries on cubes ("... or a level query"), but the bundle lowers image_get_lod on cubes (cbc8c33). That refusal is dropped and only texel coordinates (both sides) and texel offsets (Marvisak#160) are refused on cubes. The bundle's `face` variable is kept in place of Marvisak#160's `cube_face`. 5. sample (60): the bundle's constant-offset code is the base code with addr_dword. Marvisak#160 moved offsets before the match (immediates in -8..7, otherwise a coordinate shift at a level known here) and added the clamp. Took Marvisak#160's version, reading the word with addr_dword. 6. sampleBias (61): bundle addr_val(offset_word, 0) + to_float, Marvisak#160 float(bias_at). Both read the same position, an f16 low half with a16. Kept the bundle's comment and Marvisak#160's reader, plus Marvisak#160's clamp. 7. sampleGrad (63): the bundle reads `graded` 32-bit derivatives per direction, turns cube face derivatives into direction derivatives after reading, and reads its own _cl clamp. Marvisak#160 reads through grad_at (g16 too) with a per-face branch. Kept the bundle's structure (loop over `graded`, then the cube conversion) reading through Marvisak#160's grad_at, so _g16 works. The bundle's inner clamp is dropped for Marvisak#160's clamp, which comes from the same position (coordinate `coords`) and now covers every _cl form. Marvisak#160's `_cd` shortcut comment is kept. 8. sampleCmp/LevelZero (64/65): the bundle reads addr_dword(first - 1) and Marvisak#160 reads float((o + b, None)). These are the same dword, since first = o + b + c and c is set. Kept the bundle's line. Marvisak#160's clamp is pushed for SampleCmp. 9. sampleLevel (62): bundle name == "image_sample_l" with addr_val(at, coords), Marvisak#160 f.l with float(coord_at(coords)). These are the same position. Took the form test so that _l_o and the others are covered. 10. gather (default arm): the bundle's checks and per-lane offsets are the base code with addr_dword. Marvisak#160 moved the checks into the op choice (level 0, comparison gathers, GATHER_AT_LEVEL) and the offsets ahead of the match. Took Marvisak#160's. Duplicate method: 10ac6ce (bundle) and Marvisak#160 both add Lower::cube_gradient with the same table (u, v move by 2 ds, 2 dt, the major axis by 0). With no conflict git kept both. Kept Marvisak#160's, which shares by_face with cube_direction, and removed the bundle's. Marvisak#180 interaction (integration fix from Marvisak#160 (comment), r4tedx): Marvisak#180's compute image_sample/_b arm (sampleGrad from quad gradients) dropped the level clamp, and before 5703405 it also read the bias at dword 0. With Marvisak#160, _b_o, _cl and _b_cl_o reach that arm. The arm now reads the bias with float(self, bias_at) (after the offset word, an f16 with a16; this is the same position 5703405's addr_val(offset_word, 0) + to_float read) and pushes Marvisak#160's level clamp instead of undef. Marvisak#160 x Marvisak#306 interaction (no textual conflict; emit/shader.rs, lower.rs): Marvisak#306 declares dx.valver 1.8 for a compute module with an implicit-derivative sample (cs_derivatives, which Marvisak#180's sampleGrad arm also sets). Validator 1.8 counts a sample's level clamp (a non-undef clamp operand) as TiledResources use, and 1.6 does not. Marvisak#160's _cl forms in compute (Marvisak#180's arm with the clamp above, and SampleCmp for _c_cl) therefore failed "Flags must match usage" in sample_and_gather_forms_lower_to_valid_dxil, comparisons_and_comparison_gathers_ match_per_texel_comparisons and texel_offsets_and_levels_sample_the_texels_they_name (declared and actual flags differ by exactly 1 << 12). Marvisak#160 alone declares 1.6, where this does not apply. Added flags::TILED_RESOURCES (bit 12, SFI0 0x100). It is set when a sample takes a level clamp (Shader::lod_clamp) and the module declares valver 1.8. Still needed on this Marvisak#1511 head: its Marvisak#1402 (119b763) only skips two of Marvisak#306's own tests when dxil.dll is older than validator 1.8 and does not change what Marvisak#306 declares. Checked (on the previous Marvisak#1511 head, 289f241, which also carried Marvisak#98; this replay was checked with cargo check --workspace --all-targets --all-features and the full suite at the end of the line): cargo build --workspace --all-targets, clippy -D warnings, xtask policy. cargo test --workspace on an RTX: 427 passed, 0 failed, 6 ignored. With VICTORY_WARP=1 --no-fail-fast: 426 passed, 1 failed (valu_tests:: v_cndmask_on_an_untracked_mask_tests_this_lanes_bit, which also fails on the base), 6 ignored. #[test] count: base 424 + 8 from Marvisak#160 = 432 in the tree; the victory-shader lib lists all 204 of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, Marvisak#320, Marvisak#439) onto Marvisak#160 + Marvisak#309 + Marvisak#180 + Marvisak#704 + Marvisak#1511 PR Marvisak#439 head 28aca3b (46 commits over main: Marvisak#223 wave-range targets, Marvisak#233 split halves and the console flow, Marvisak#320 lane reads where lanes branch, Marvisak#439 LDS in one console wave, whole-wave sections across the halves, ds_bpermute, numeric selects), merged onto the Marvisak#160 merge (b821b31), as the wave64 line of integ/next-v3. emit/wave.rs: no conflict on this Marvisak#1511 head. The previous head carried Marvisak#98 (f468457, v_permlane16 modelled next to v_permlanex16, only with every lane active), which conflicted with Marvisak#439's a31c82e (an inactive lane also accepted when fi, opsel bit 0, is set). Marvisak#98 is no longer in the bundle, so the whole-wave simulation is Marvisak#439's: v_permlanex16 only, under `exec == all || v.opsel & 1 != 0`. structure.rs (1 hunk): the bundle only reformatted `paired_masks`; Marvisak#439 moved it after the new `execs`/`others`/`pairs` fields because `pairs` borrows `self.masks` before `paired_masks` moves it. Kept Marvisak#439's order with the bundle's formatting. emit/waterfall_tests.rs (3 hunks): 1-2. The bundle split `build` into `build_with(words, buffers, nonuniform)` (a program with no per-lane handle, whose first-lane read is a wave operation); Marvisak#439 split the same function into `native`, `lower_as` (per-lane or console flow) and `host_shader`. Kept Marvisak#439's helpers and the bundle's `build_with` on top of them (lower_as(.., false), the bundle's two asserts, host_shader). host_shader keeps the stride_table field (Marvisak#704), which git merged outside the hunk. 3. Tests at the end of the file: the bundle's side ends inside the `for` loop of a_descriptor_only_read_as_data_gives_its_views_size, Marvisak#439's inside the `for target` loop of its last test. The bundle's test is closed before Marvisak#439's tests, so none is nested in another. emit/lower.rs (6 hunks): 1, 3. Lower fields and their initializers: the bundle's `mask_scc` (Marvisak#309, SCC of a mask operation read as data) and Marvisak#439's `opaque_open` (stops the recursion of a mask copied dword by dword). Both kept. 2. Which compute programs need the console's lanes. The bundle (Marvisak#309) counts only live instructions (`sgpr_spill::dead`: lane moves forwarding left unread are not lowered); Marvisak#439 split the test into in-half reads, whole reads and masks held as numbers and added the split/console-flow choice. Kept Marvisak#439's structure, reading `live()` for reads_whole and in_half, and for lane_access_outside_sections (the console-flow trigger for lane reads where lanes branch differently). 1ca87f7 (in Marvisak#439) notes that the tester tree's `live()` filter belongs here once Marvisak#309 is in. 4-5. Selects on masks the structure does not follow. The bundle (48a41fb, from Marvisak#585) added `mask_cond` for v_cndmask_b32 and the v_*_co_ci_u32 carry-ins: inline 0/-1 constants, the tracked boolean, else with console lanes this lane's bit of the register's number (pair in wave64). Marvisak#439 (e461457, 1ca87f7, ccd9c44) takes, for v_cndmask only, the structure's boolean for masks held as numbers (`Structured::others`, which also finds the high word written by another instruction), only where the host lane is the console lane (not split in halves without the console flow), and declares console lanes for them only on a second lowering after the first stops on such a select (`lower`). Combined in `mask_cond`: tracked boolean, then Marvisak#439's `others` boolean, then the bundle's register number, both under Marvisak#439's condition (console lanes and not split without the console flow; the bundle's number path called lane_bit, which is wrong in a split program, where Marvisak#439 asserts it is never called). Both instructions use it; v_cndmask now also takes the bundle's inline constants. Without a textual conflict git had also kept the bundle's unconditional rule (any untracked select or carry-in declares console lanes) inside Marvisak#439's masks_held, which undid 1ca87f7 (a select nothing reads made a wave64 program in a group of more than 64 threads untranslatable on a 32-lane host). The rule now counts live instructions and applies only on Marvisak#439's second lowering, which now also follows an untracked carry-in ("a carry-in from an untracked mask", UNTRACKED_CARRY). It covers every untracked selector, not only Marvisak#439's held masks with an opaque or constant atom, since the bundle's number path needs console lanes for selectors outside `others` too; on the first lowering nothing changes. 6. lower.rs test helper: Marvisak#439's three new Parts fields with the bundle's formatting. Not textual, did not compile (test code only): Marvisak#439 gives `emit` a Target and `lower::Parts` target/console_cf/per_lane_only. Tests that came with the bundle, Marvisak#704, Marvisak#309 and Marvisak#160 used the old forms: image_tests.rs `lower`, emit/mod.rs (3 emit calls, the stride-table Parts), lower.rs (2 Parts in the int64 atomics tests), root_view_tests.rs, sgpr_spill.rs tests and victory-gpu raw_view_tests.rs. They pass Target::ANY, console_cf false and per_lane_only false, as Marvisak#439 did for the upstream tests. Not textual, test-only (split_tests.rs): with Marvisak#309 a v_readlane whose result nothing reads is dead (not lowered and, above, not counted). saveexec_scc_tests_new_exec_not_saved_exec and loops_leave_on_the_new_exec_of_saveexec used `v_readlane_b32 s14, v0, 10` with s14 unread only to take the console flow. After the merge the loop test failed on the RTX (per-lane form, lane t counted t + 1 iterations where the console counts 64; it passes on Marvisak#439 alone), and the saveexec test passed without taking the console flow (its per-lane result is also 42). Both now read s14 once (`s_mov_b32 s15, s14`, the branch over the body +4), and a first lowering of each was checked to ask for the console flow again on a 32..32 target. Marvisak#180 interaction: r4tedx's integration (24b3bcc, from Marvisak#180 5ff639e) put `implicit_derivatives` among the in-half reads that make a program need console lanes. The Marvisak#180 merged here is aa69258, whose last commit takes quad gradients out of the console-lanes test altogether ("a quad's four lanes share a host wave of any size"), so there is no such term to place. The quad reads stay inside one host wave in both Marvisak#439 forms (each half is a host wave in the split and in the console flow, and in the console flow samples run in every lane and are kept by a select on EXEC). Checked on the previous Marvisak#1511 head (289f241, with Marvisak#98; this replay was checked with cargo check --workspace --all-targets --all-features and the full suite at the end of the line), on an RTX 4060 Laptop (32..32): cargo test --workspace --locked: 468 passed, 0 failed, 6 ignored (base 427 + 41). The 41 tests Marvisak#439 adds all pass; the GPU ones ran on the RTX in two 32-lane halves ("split true"). VICTORY_WARP=1: 467 passed, 1 failed, 6 ignored; the failure is valu_tests::v_cndmask_on_an_untracked_mask_tests_this_lanes_bit, which fails on the base too (a fixed-WaveSize pipeline on WARP). victory-shader lib tests listed: 204 -> 244 (Marvisak#439 adds 40 there and 1 in victory-gpu). cargo clippy --workspace --all-targets -D warnings and cargo xtask policy clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…visak#320, Marvisak#439) with the GPU line Both lines start from the Marvisak#160 merge (b821b31). One conflict, in crates/victory-gpu/src/shader_cache.rs tests: the GPU line (Marvisak#1439) adds `a_cache_that_cannot_keep_an_entry_still_gives_the_translation`, the wave64 line (Marvisak#439) adds `keys_tell_hosts_wave_sizes_apart`, at the same place. Both kept as separate tests (the shared text holds the closing brace and the `#[test]` attribute).
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
The two reference draws create a host and draw on the hardware adapter and WARP without `valu_tests::ONE_AT_A_TIME`, so on CI's WARP adapter they could dispatch at the same time as the other GPU tests; the run on 6ddbdfc ended with the victory-shader test process dying with STATUS_ACCESS_VIOLATION and no failing test named, the crash seen before on Marvisak#704, Marvisak#160 and Marvisak#265 for that reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing this rather than rebasing it. By count. Local title data (v1.0.2.1, the main shader archive), offline, CPU only; counts and reasons only.
By what is read. A count cannot show whether
@upipibi thank you for the in-world evidence. The case you describe, the culling's 4×4 block of the depth pyramid read with one Limits. The count and the passes cover one archive, not shaders elsewhere in the title. A refused program reports only its first reason, so a refused image form could still sit behind another reason in the programs The branch Thank you to everyone who tested and measured this head. AI-assisted |
…IL validator failures) into the integration Its fixes are already here (a16 biased samples from Marvisak#138/Marvisak#160, the centroid position under conservative depth, one interpolation mode per packed row, signature parts in the validator's order), and compute samples take quad gradients (Marvisak#180) instead of validator 1.8. The code stays ours; three of the PR's tests are taken (conservative depth, signature order within a row, the a16 biased sample) and pass. Its tests of harmonize_row_interp and of dx.valver 1.8 test code that is not taken. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
Rebased onto
main58fed37(head3ef252e, 2026-11-24). #634 (image_sample_owith constant offsets) merged and conflicted with this branch inemit/lower.rs. This branch already lowers that form: constant offsets in -8..7 become the same immediates #634 emits, and it also takes offsets past that range or per lane at a known level, which #634 refuses. So the rebase keeps this branch's offset code and uses #634'sModule::int_valueto read the constant. Its offset test (texel_offsets_and_levels_sample_the_texels_they_name) passes on the RTX 5070.cargo test -p victory-shaderat3ef252e: 97 passed, 1 ignored. The measurements below were taken at25e917b, before the rebase.The last commit (
3ef252e) is not part of this change: onmainthe test target ofvictory-shaderdoes not compile (issue #719; #117's test calls #612's changed helper with one argument). It passes the missing argument so this branch's tests can run, and goes away whenmainhas the fix.What
fn imageaccepted a fixed list of sample and gather opcodes; every other MIMG form failed the whole shader. Samples and gathers now lower by their form (comparison, derivatives, coarse or 16-bit derivatives, level, level 0, bias, level clamp, texel offset). The address dwords follow LLVM'sImageDimIntrinsics/SITargetLowering::lowerImageand Mesa'sac_build_image_opcode: offset, bias, reference, derivatives, coordinates, level or clamp.Newly lowered:
_o) onimage_sample,_lz,_l,_b,_d,_c,_c_lz: DXIL immediates when the offset word is a constant in -8..7; otherwise the coordinates move by offset / size, only at a level known at translation._cl(the DXIL clamp argument),_cd(as_d, marked as a shortcut),_g16.image_sample_d,_d_cl,_cd,_g16forms): two derivatives per direction, those of the face coordinates, turned into the direction's derivatives forSampleGrad.image_sample_c,_c_cl(and_o) in compute as well as pixel shaders;image_sample_c_l(_o)at a level known to be 0;image_sample_c_b(_cl)(_o)with a bias known to be 0.image_gather4_l(_o)at any level. A level known to be 0 is a real gather; a run-time level is four samples at the footprint's texel centres at that level, so the sampler's own address mode and level range apply.image_gather4_c_lz(_o)andimage_gather4_c_l(_o)at level 0 throughtextureGatherCmp._g16opcodes have 16-bit derivatives); the decoder onmaincounted them packed, fixed here.image_storeof some channels: the data VGPRs are the dmask's channels in order; the others are written as 0.Still refused, each with its own reason: gathers at an implicit level or with a bias; comparison gathers and cube gathers at a level not known to be 0; comparisons with derivatives, or at a level or with a bias not known to be 0 (SampleCmpLevel is SM 6.7, SampleCmpBias/Grad 6.8); offsets past -8..7 or per lane at a level not known here; offsets, texel coordinates and level queries on cubes.
Measured on the title's shaders
By @EduAzevedo (comments below),
victory translate --jobs 8 --listover the retail 1.0.2.1 shaders,maind2a4baeagainst this PR at25e917b:mainimage_sample_d_cl(all on cubes)a cross-lane operation outside compute)image_gather4_l(compute)a biased image sample with 16-bit coordinatesimage_sample_omainand no longer doValidated, by TrashTalker3460 (comment):
victory translate --validate --listover the 1.0.2.1shaders.rpfalone (26,084 programs, so the baselines are 12 lower than above), with DXC 1.9.2609's validator,maind2a4baeagainst25e917b:mainmainand no longer doAll 12
image_gather4_lprograms and the 23image_sample_d_clprograms that emit also validate. Of the 108 programs freed froma biased image sample with 16-bit coordinates, 36 validate, 48 stop next ata scalar memory read as data, 16 ata lane mask read as data, and 8 emit but fail validation withContainer part 'Program Input Signature' does not match expected for module. Those 8 are pixel shaders of one family (three distinct programs). #201 counts 21 input-signature mismatches of that kind onmain, so they may be that existing problem reached for the first time; whether this PR's sampling path plays a part is not established.With host pipelines, by adnanoos (comment):
victory translate --list --pipelinesovershaders.rpfon an RTX 5060 Laptop,mainffe310eagainst5ce85c5. That run counts 16image_gather4_lprograms where the table above has 12: 10 meshlet-culling compute programs, which all translate and get host pipelines, and 6water_micro_geom_rendererones, which translate and whose pipelines the NVIDIA driver refuses withE_INVALIDARG, as it refuses about 320 compute pipelines onmain. Vertex and pixel modules with pipelines: 12,231 to 12,300. One title run each: the world is black with audio on both;mainended in a device removal and this PR did not, with a warm pipeline library, so that difference is not established.In the title, by nullmarsh (details): on an RX 9060 XT,
d2a4bae+ #135 + #365 + #500 with and without this PR at25e917b, 12 traced world frames per run, 2 runs each. Without it, #293's top G-buffer pixel shader7bdefdfde461f6e3is refused forimage_sample_d_cland everyExecuteIndirecton its pipelines is dropped (692 and 1,017 in the two runs). With it the shader translates and all of them run, none dropped; the run-timeimage_sample_d_clrefusals go from 3 programs to 0. There was no visible change (the frames are still black apart from the title card) and no device loss in those four runs.What those draws write, same tester (target dumps, one run per arm): the pipelines of
7bdefdfde461f6e3(mesh792314eae4f7da77) write six 2560x1440 colour targets and the depth target. Without this PR, and with it but that shader skipped, 5 to 6% of depth is non-background. With this PR, depth is 94% covered with only 6 distinct levels and the colour targets 100% with 1 to 4 levels: the draws now run and cover the screen with near-constant values, not a scene. With #587 on top the targets look like the run without this PR. So a build that takes this PR without a fix for what that mesh program emits (#586 / #587 work on that) gets screen-covering output from these draws. Whether the near-constant colour comes from the geometry alone or also from this PR's sampling is not established.These are two rows of #293's ranking (
image_sample_d_cl,image_gather4_l). The cube gradient and run-time-level gather support were added because of the first run: everyimage_sample_d_clin the title is on a cube, and noimage_gather4_lhas a provably zero level. Not measured: whether the translated programs compute the right result in the title, and whether these cubes are cube arrays (the lowering treats the view as a cube; for an array the face operand adds 8 x the slice, ashortcut:already onmain).Checked against the references
lowerImage, "Bias is of type half but occupies full 32-bit". Shaders: support image_sample_b with a16 and _cl LOD-clamp variants #73, Shaders: s_buffer descriptor reads, signature/PSV0 fixes, gather4_l, a16 samples (+479 VS/PS, +200 mesh validated) #136, Shader: fix biased 16-bit image samples and DXIL validator failures #306 read it as an f32; noted there.gfx10_asm_mimg.shasimage_sample_d ... 2D a16with five address dwords,image_sample_d_cl ... 2D a16six.DMASK: "Writes: defines which components are written with data from VGPRs (missing components get 0). Enabled components come from consecutive VGPRs."Known limits
shortcut:in the code.image_samplein compute onmainalready does; the tests accept that one error for those forms.Overlap
_cl/image_sample_d_cl, Shaders: s_buffer descriptor reads, signature/PSV0 fixes, gather4_l, a16 samples (+479 VS/PS, +200 mesh validated) #136 and shader: support image_sample_o and image_sample_lz_o texel offset opcodes #360image_gather4_l, Shaders: gradient samples on cube images #138 cube gradients, Shaders: lower partial-channel image_store #332 partial stores. Where they differ from this PR I have left notes on each with the reference that settles it. Whichever lands first, I will rebase.Tested
Windows 11, NVIDIA RTX 5070, hand-assembled programs:
dxil.dll; refusal reasons are checked; the decoder's address counts are checked against LLVM's.cargo test -p victory-shader: 77 passed. clippy: nothing new.cargo xtask policy: ok.The title was not used in my tests; the title measurements above are the named testers'. AI-assisted.
🤖 Generated with Claude Code