Repository navigation
Conversation
|
Regression run wanted. We have no title on our machine. If you can run 🤖 Claude Opus 5.5 |
… rect's corner Their work, merged as it is. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Regression run on a retail title, as asked. Both blocks are the unedited output of Hardware: Ryzen 9 9950X3D, NVIDIA GeForce RTX 5090 (32 GB), Windows 11 Pro 26300, Rust 1.100.0. Note on the main ( this PR's head ( What it covers: the title's first screens draw their full-screen passes as rect lists through What it does not show: the PR's run has 18 fewer frames (1060 vs 1078) and 299 MB more peak commit. One run each, with no input, so I cannot say whether that is the change or run-to-run variation; the title starts streaming near the end of the 60 s, which is where the last "presents per 2 s" figures differ. I did not compare the picture between the two runs, and this title has no rect with its corner at v0 that I know of, so the new branch itself is not exercised. Both runs were on my machine; Claude Code (Claude Fable 5.2) ran the script and wrote this report. |
|
@theaustinayers thank you, both blocks are in the description now. One question from your note that the full-screen passes go through
No need for another run if the log from the one above is still there. 🤖 Claude Fable 5.2, Claude Opus 5.5 |
|
At |
e30794d to
b224d77
Compare
|
Thanks, @shdann, that was right: each slot picked its own corner, and your example paired the fourth position (1,1) with 30. Changed in
🤖 Claude Opus 5.5 |
|
I tested clean head
The position words give Can the CPU path use position data for corner selection when the layout identifies it? If that data isn't available, this seems worth documenting as a limitation of the fallback. AI use: OpenAI Codex (GPT-6.2 Sol) ran the tests, wrote the synthetic probe, and drafted this report. |
b224d77 to
7f08b78
Compare
|
Thanks, @Alpha325, confirmed. On Changed in
Tested on an RTX 5070 Ti (driver 610.74), debug: the bind and rect list tests on 🤖 Claude Fable 5.2 |
7f08b78 to
14fecf8
Compare
|
Test run of Tested
Review: The CPU expansion now takes the rect's missing corner from its positions instead of assuming a vertex order, and the GPU rect-list tests agree. I found nothing to change. Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
draw_rects made every rect's fourth corner as v0 + v2 - v1, which is right when the rect's corner (the vertex between the other two) is v1. Rects are also sent with it at v0 - (x1,y1) (x1,y2) (x2,y1), as Mesa's r600 and radeonsi blits do - and then the fourth vertex landed outside the rect, at (x2, 2*y1 - y2). The corner is now found from the vertices (the one that differs alone in the fewest words; v1 when there is no single one, as before), and the fourth corner is a + b - corner. Both triangles start with v0 and keep the winding of v0 v1 v2. For a rect with its corner at v1 the six vertices are the ones made before. A rect's vertices in several vertex buffers get one corner, and every slot's six vertices use it. Each slot on its own could find another: an attribute with no word two vertices share falls back to v1, and paired a position with another corner's attribute (review by shdann). The corner is found from the positions alone where the pipeline's input layout names them: an element POSITION or SV_Position of two to four floats, noted when a translated rect list pipeline is made. With every word of the vertex voting an attribute could outvote the position: with (0,0) (1,0) (0,1) and a float2 of (1,1) (.5,.5) (.5,.5) v0 differs alone in two words, the corner was taken as v1 and the fourth position came out at (-1,1) instead of (1,1) (review by Alpha325). A layout that does not name the positions is still expanded from the words of all slots, as if they were one interleaved vertex. Assisted-by: Claude Code (Claude Fable 5.2) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
14fecf8 to
6bf3305
Compare
Title: Rect lists: the CPU expansion finds the rect's corner, not always v1
The CPU expansion of rect lists (#195) makes every rect's fourth corner as v0 + v2 − v1. On #189 (closed) the question was whether that holds for every vertex order. It does not: it is right when the rect's corner (the vertex between the other two) is v1, and for a rect with its corner at v0 it puts the fourth vertex outside the rect, at (x2, 2·y1 − y2). This PR finds the corner first.
Both orders are in use on AMD hardware:
r600_draw_rectangle("The hw rectangle has only 3 vertices, The 4th one is derived from the first 3"); Mesa radeonsi's blit VS, from the vertex index (load_vs_input_from_blit_sgpr); radv's meta passes (nir_gen_rect_vertices)r600_exa.c, drawn asDI_PT_RECTLISTinr6xx_accel.c); the full-screen passesdraw_rectswas written fromThe two r600 drivers run on the same chips, so the hardware does not take a fixed vertex as the corner. The rect list GS (#199) already finds the corner from the positions; only the CPU path assumed v1. Both drivers were read for the vertex orders; no code is taken from them.
What is in it
crates/xcl/src/hle/d3d12x/bind.rs,rect_corner: which of a rect's three vertices is the corner. It goes by words: in a word two vertices share (an x or a y, and a texture coordinate that follows it) the third vertex is the far end of an edge, and the corner is the vertex that differs alone in the fewest words. No single such vertex (not three corners of a screen-aligned rect): v1, so those draws are expanded as before.bind.rs,expand_rect: the fourth corner is a + b − corner, word by word as before (a word equal in all three vertices is kept). Both triangles start with v0 and keep the winding of v0 v1 v2. For a rect with its corner at v1 the six vertices are exactly the onesmainmakes.bind.rs,expand_rect_streams: one corner for a rect whose vertices come from several vertex buffers, and every slot's six vertices use it (review by shdann: each slot on its own could find another corner and pair a position with another corner's attribute). It is found from the positions alone where the input layout names them (review by Alpha325: with every word voting, another attribute could outvote the position). Where the layout does not, it is found from the words of all slots, as if they were one interleaved vertex.crates/xcl/src/hle/d3d12x/real.rs,layout_positionandrect_position: where a rect list pipeline's input layout has the position, as slot, byte offset and bytes. That is its element namedPOSITIONorSV_Position(index 0), two to four 32-bit floats read per vertex. It is noted when a translated rect list pipeline is made (translated_graphics_pso) and forgotten with the pipeline.bind.rs,draw_rectscopies each rect from every slot, looks up where the bound pipeline has the position and calls it; nothing else there changes. This path only runs for a rect list pipeline without the rect list GS, forDrawInstancedwith vertex buffers.bind.rsrects_expanded_on_the_cpu_have_the_corner_opposite_their_own,a_rect_split_over_vertex_buffers_has_one_corneranda_rects_corner_is_found_from_its_positions; inreal.rsrect_list_pipelines_know_where_their_layout_has_the_position. +294/−22 in all, about 125 of them the tests.Overlap: #267 and #533 edit
bind.rs, and #267 also adds five lines toforget_psoinreal.rs, which this PR adds to as well. Both already conflict withmain18c105ainbind.rs, as #150 and #164 do inreal.rs. The other open PRs that touchbind.rsorreal.rsmerge with this head without conflicts in these two files (git merge-tree): #214, #236, #292, #303, #310, #317, #433, #466, #473, #539, #541, #562, #567, #578, #625, #630, #634, #637. No open PR or issue is about rect lists.Tested
14fecf8, one commit onmain18c105a. It was rebased from7f08b78on508a0c7: D3D12.X: ExecuteIndirect with a pipeline still being built is skipped (Austin's fork fix, upstreamed) #574 and this PR each added a test at the same place inbind.rs's test module, and both are kept; no other line of the commit changed.cargo test --workspace -- --test-threads=4(debug) on6bf3305, onmain06c9f55: 1269 passed, 0 failed, 46 ignored (thexcllibrary: 1200 passed, 26 ignored). SKIPPED: 25 notices from 15 GPU tests (21 for no wave64, three refused per-lane cases, one for no heap windows), the same asmain06c9f55, which gave 1265 passed, 0 failed, 46 ignored.7f08b78, onmain508a0c7, hung in D3D12.X: replacing the sparse state deadlocks when the old state still holds placed buffers #344 on its own (a watchdog stopped the run after 240 s without output) and ran 685 passed, 0 failed, 41 ignored with D3D12.X: the sparse state is replaced outside its lock #443's commit (16fc79d) on top.14fecf8did not hang in its one run, without D3D12.X: the sparse state is replaced outside its lock #443.cargo test -p xcl --lib -- hle::d3d12x::bind::tests rect_liston14fecf8: 16 passed, 0 failed. Those are the eight tests ofbind.rs(one of themmain's new one from D3D12.X: ExecuteIndirect with a pipeline still being built is skipped (Austin's fork fix, upstreamed) #574), the four ofreal.rs's rect list pipelines and four of the rect list GS; the four tests named above need no GPU.b224d77the fourth position is (−1,1) in both (a scratch test:no fourth corner at (1,1): [(0.0, 0.0, 1.0, 1.0), (1.0, 0.0, 0.5, 0.5), (0.0, 1.0, 0.5, 0.5), (0.0, 0.0, 1.0, 1.0), (0.0, 1.0, 0.5, 0.5), (-1.0, 1.0, 1.0, 1.0)]). With the positions named it is (1,1) and every vertex carries its own position's attribute. Without them it is still (−1,1); the test asserts both.Position, three floats, in slot 1 at offset 4 gives (1, 4, 12), and is forgotten with the pipeline. No position: a pipeline that is not a rect list, a layout without the name, 16-bit floats, a per-instance element, index 1, and an appended element after another of its slot.e30794ddid, it fails:[(0.0, 0.0, 10.0), (1.0, 0.0, 20.0), (1.0, 1.0, 30.0), (0.0, 0.0, 10.0), (1.0, 1.0, 30.0), (0.0, 1.0, 20.0)]. With one corner for the rect it passes.main's rule: with the corner fixed at v1 it stops atcorner v0: no vertex at [48.0, 24.0] in [[16.0, 8.0], [16.0, 24.0], [48.0, 8.0], [16.0, 8.0], [48.0, 8.0], [48.0, -8.0]].mainhas this arithmetic inline indraw_rects, where a test cannot call it.expand_rectas ofe30794d, one vertex buffer): for each of the four orders 0 of 256 pixels wrong (rect covered, texture coordinate right), 36 wrong when only the three vertices are drawn.main9ab7d76and the previous heade30794d(another title), no crash or device removal (Rect lists: the CPU expansion finds the rect's corner, not always v1 #266 (comment)).Regression run
Our own runs with
scripts/smoke.ps1, 120 s each, one after the other on the machine under Tested (RTX 5070 Ti), release builds from clean trees, on the direct route:XCL_DIRECT_DXIL=1, each run with its own XCL cache that starts from the same list of used pipelines (the driver's own cache untouched).mainat0829441(a newermainthan this PR's base06c9f55, which it contains), then this PR's head6bf3305. Themainrun is shared: one run serves this PR and #2098, #245 and #350.main:
PR:
PR vs
main: 1298 / 1323 frames (98 %), peak commit 30981 / 30938 MB (100 %); device removals 0 and crashes 0 on the PR run, 0 and 0 onmain.Not tested
draw_rects: the smoke runs above are a regression check only.17 - DI_PT_RECTLIST: Rect List); they do not say how the fourth vertex is derived.draw_rectsitself (a console command list, title vertex buffers, the upload memory) has no test, as onmain; only the expansion it calls does.POSITIONorSV_Position, a position that is not 32-bit floats, and one appended (D3D12_APPEND_ALIGNED_ELEMENT) after other elements of its slot are expanded from the words of all slots. There an attribute in which the corner alone differs from the other two vertices can outvote the position, and the corner is then taken as v1, as before this PR. The same goes for rect list pipelines with a console GS or with PC shaders, which note no position.draw_rects(the bound pipeline, a stand-in resolved, to the slot's stream) has no test, like the rest ofdraw_rects.main.main: indexed rect list draws,ExecuteIndirect, and vertices made from the vertex index alone, in pipelines without the GS. They draw half of each rect.AI use
18c105aand the runs on14fecf8