Tests: a root constants write past the last parameter keeps the part that fits #3511
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3511"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T07:46:22Z.
Tests for the case the retail title hits and #1319's own test does not: a root constants write that runs past the end of the last parameter, where it is also the end of the argument table. A retail title's BVH builder writes 4 dwords into compute parameter 3, the last of a 9-dword table (3 fit). Before the clip
bind::put_indropped the whole write, the radix pass read a null BVH header, and the refit's box stores corrupted the vertex and index lists. With the clip alone, in our diagnostic tree, the count of 24-byte corrupted runs in those lists went from 80 to 0, and the refit's loads of parents that were never written from 30.7M to 1 (test report on #1319). Part of #2867.What is in it
Tests: a root constants write past the last parameter keeps the part that fits(crates/xcl/src/hle/d3d12x/bind.rs,mod tests, +72 lines, no runtime change):test_rts0_blob()leave 1, 2, 3, 4;console_list.rs. Its table is a local ofclose()and is visible only through a translated dispatch (UMA + GPU), so a unit test would need a refactor; left out.Tested
ecac034d, rebased onto main9dfbe3ea(which has #1319).41615fe9(same diff, main07eec51e+ #1319): the three new tests with #1319'sput_inchange in: 3 passed. Withput_inreverted to main's body (temporary, not committed): 3 failed, all on the table staying zero:a_write_past_the_last_parameter_keeps_the_part_that_fits: left[0; 16], right[1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0]four_constants_at_the_last_of_three_views_and_three_constants_write_bytes_24_to_35(and thegraphics_one): left[0; 12], right[161,0,0,0, 162,0,0,0, 163,0,0,0]ecac034d(gpuq job 20261130-132119-e3f0),cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 2888 passed, 1 failed, 51 ignored in total (lib 2740 passed, 1 failed, 31 ignored). 25SKIPPEDlines.gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, which also fails on bare main9dfbe3ea(3 of 3 runs alone; fixed by #3513).two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobspassed on this head; it fails on bare main9dfbe3eaand on #3512's head (gpu_two_pass_cache_e2e.rs:472), so it is main's.0xc0000409abort in this run.Regression run
main:
This PR's head:
Not tested
AI use
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:03:07Z.
Review (head
ecac034d, diff read, not a merge-check:PR descriptionfails without thetest-onlylabel, so not built or run here):put_in(bind.rs~1461-1488, which already has #1319's clip): 5 dwords into a 4-dword parameter keep 16 bytes; 4 dwords at parameter 3 (byte 24, 3 dwords) stop at byte 36, the end of the table; the root-descriptor setters store the VA unchanged, so the view asserts hold; and the addresses0x7100_0F3xaren't used by any other test.PR descriptionis red becausebind.rscounts as a runtime file; the diff is entirely insidemod tests, so it needs thetest-onlylabel from a maintainer.Fine: test-only, drives the real
set_*_root_constants/_descriptor->put_inpaths, covers the end-of-table case #1319's test doesn't, and the reverted-clip failures are reported.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:06:32Z.
Triage (#1607) – head
ecac034No open or merged PR has these tests. #1319's
out_of_bounds_root_constants_do_not_clobber_adjacent_parametercovers a clip in the middle of the table; these cover a write past the last parameter, at the end of the table, which main's pre-#1319put_indropped whole. #3512 adds a warning input_inand is separate.The root signature blob in
three_views_and_three_constantslays out as the asserts expect (3 x 8-byte views + 3 constants = 36 bytes). No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T19:06:46Z.
merge-check
base:
6bfb5c5153head:
ecac034d69merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2907 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none
review: read the whole diff (
bind.rs, +72, all inmod tests; test-only). No findings.put_in, which already has #1319's clip (write_end = end.min(limit)).write_end = end, so a write past the argument table is dropped, as before #1319) fails all three:a_write_past_the_last_parameter_keeps_the_part_that_fitsfour_constants_at_the_last_of_three_views_and_three_constants_write_bytes_24_to_35graphics_four_constants_at_the_last_of_three_views_and_three_constants_write_bytes_24_to_35Good: they cover the end-of-table case #1319's own test does not.
hle::d3d12x::bind::tests::at--test-threads=8, 30 runs: 20 of 30 ok on this merge, and also 20 of 30 on main6bfb5c5. The failures are not this PR's tests:later_queue_completion_during_sleep_reclaims_before_wait_deadline(9 on the merge, 10 on main;bind.rs:10023,left: Stopped) and oncewait_oldest_fenced_reclaims_in_flight_buffer_before_refusingon the merge.bind.rscounts as a runtime file forpr_check.py, so it still needs thetest-onlylabel.performance: none: test code only.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:32:48Z.
merge-check
base:
1c8b551475head:
ecac034d69merge: clean (trial-merge commit 989bd4858c4c101dc7f4fcff683f9d4bd2417697, git diff --check clean)
build: cargo build --workspace ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets): 2912 passed, 0 failed, 51 ignored (+3 new tests vs main baseline). All 3 new hle::d3d12x::bind::tests passed with 0 skips (a_write_past_the_last_parameter_keeps_the_part_that_fits, four_constants_at_the_last_of_three_views_and_three_constants_write_bytes_24_to_35, graphics_four_constants_at_the_last_of_three_views_and_three_constants_write_bytes_24_to_35). 28 SKIPPED lines (host environment only: 22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)).
review: Read the full merged diff (+72/-0 in crates/xcl/src/hle/d3d12x/bind.rs, test-only inside mod tests). Adds three unit tests locking in root-constant clamping when a write exceeds the final root parameter's dword count (5-into-4 on compute, and 4-into-3 after three 8-byte root views on both compute and graphics lists, checking bytes 0..24 preserve the views, bytes 24..36 keep the 3 fitting dwords, and the opposite list kind stays empty). Uses distinct synthetic list/root-signature addresses (0x7100_0F31..0F38) and cleans up via remove_state_for_test. No production code changed; no scope creep or UB.
performance: not applicable (Tier 0 — test-only diff in bind.rs, no production code changed).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:12:25Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.