D3D12.X: log the first title call of each command-list slot the newer layout moved #3139
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3139"
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 KOLESNiii on 2026-11-28T13:01:36Z.
Help wanted: evidence. This PR only measures and changes no behaviour; it is the first step for the console-layout guesses. Please run a title on this head and post
D3D12.X: newer layout, first title call of ... ← ...: (...); the older layout's method there runs(one line per slot, always on; in the retail game's 60 s run none of the 16 watched slots was called) here (not the whole log). It shows which moved slots titles call and with what arguments, the evidence the newer-layout slot fixes need. The retail game logs none of these lines in 60 s, so we need other titles.Overlap with #1274: #1274 rewrites
NEWER_LIST_SLOTSas a multi-line table (a text conflict with the constant this PR adds above it) and installs older-layout handlers at #99 / #124 / #125 / #140, which are newer-layout collisions. If #1274 lands first, this PR adds those four toNEWER_LIST_COLLISIONS.The newer console command-list layout inserts two marker methods at #59 / #60 and moves the
methods after them by two (three for the PC's List1 block). NEWER_LIST_SLOTS splits a slot only
where an older handler moved; where it stayed, the newer layout's method at that slot runs the
older handler with the wrong arguments, silently: #59 ExecuteIndirect for a GPU marker, #69
Write32BitValueBottomOfPipeX for a pipeline flush (writing title memory), #78 DispatchX for a
GDS write, #81 DrawIndexedX for a hi-stencil state, #94 RSSetDepthBiasX for CloseBundleX, and
others (from a console API audit).
Before changing these handlers, a probe on each of the 16 slots logs the first call from the
title once the newer layout is known, with its arguments, and forwards every call as before. A
run of a title then shows which collisions are live. No behaviour change.
What is in it
crates/xcl/src/hle/d3d12x/guard.rs: +49 / -0crates/xcl/src/hle/d3d12x/real.rs: +15 / -0new tests:
a_layout_probe_logs_its_first_call_on_the_newer_layout_onlyTested
NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug
Current head
587b0508(rebased ontomain765b2c5bto resolve conflicts): the suite has not been rerun on it; the counts below are from the earlier heads they name.cargo test --workspace --no-fail-fast -- --test-threads=4on5ade6ad5(built onmain336fddda; it merges into the currentmaine429936cwithout conflict): 2123 passed, 9 failed, 48 ignored, 25SKIPPEDlines (21 no wave64, 3 #1426, 1 no heap windows).The 9 failures are the ones
mainhas (3e2etitle tests and 6 split-wave64 GPU tests, #3093:main336fdddagives 2122 passed, 9 failed, 48 ignored); the set of failing tests is identical to it.a_layout_probe_logs_its_first_call_on_the_newer_layout_only: ok in that run; fails without the changeRegression run
Current head
587b0508, rebased ontomain765b2c5bon 2026-11-28 to resolve conflicts withmain. RTX 2070 SUPER, the retail game, 60 s,XCL_PRESS_AT=25:A,XCL_PREPARE=0(no startup shader preparation), release builds; each run started from a copy of the same DXIL cache (one queue job:main, then PR heads one after the other).main:This PR's head:
Not tested
Full preparation. The smoke runs used
XCL_PREPARE=0.No behaviour change. Whether any title hits one of the 16 slots: that is what the log lines will show.
AMD and Intel GPUs; wave64 hardware (the RTX 2070 SUPER is wave32).
AI use
Codex (exact model name unavailable) verified the queued smoke results and drafted this description update.
Claude Code, Claude Opus 5.5: the code and tests. The description and the test / suite runs: Claude Code, Claude Sonnet 5.5 and Claude Opus 5.5.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:34:57Z.
Triage (#1607) – head
587b050No open or merged PR adds these probes. #1274 overlaps textually (
NEWER_LIST_SLOTS), as the description says.Minor: in guard.rs the new test is inserted between the doc comment of
layout_split_keeps_the_runtime_on_the_pc_methodand its function, so that doc now sits on the new test.probedoes the module lookup before the cheapfirst_newer_callcheck on every call to hot older-layout slots (#78, #81); checking the flag first avoids that. The failing Windows check is inshaders::pipeline_librarytests that this diff does not touch.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 Foniass on 2026-12-01T10:54:51Z.
merge-check
base:
493dbd3dd0head:
587b0508eamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+65). Findings: (1) A cost on every call of 15 command-list slots, for good. Every call goes through a thunk, the runtime's own calls included, and
probe(guard.rs~145) runsimage_base_for_addr(caller)before the cheapfirst_newer_call()check. On the older layout, which most titles use, the flag never turns true, yet every call to the per-draw slots #78 and #81 still pays the module lookup. Checking the flag first (and dropping the thunk once logged) would make it nearly free. Unmeasured: the smoke below is capped at 60 presents per second. (2) It logs once per class, not once per process. The description says 16 slots; the constant (real.rs~11177) has 15. (3) The new test sits between another test's doc comment and its function (~347-351), so that comment now documents the wrong test. (4) The method names in the doc comment come "from a console API audit". HANDOFF ~1459 says where the shift starts below #83 isn't known, so please say how the names were obtained. The PR's red CI is thepipeline_library/warm_libraryflake fixed on main by2c003dd6. Fine: the log-onceswapruns only once the newer layout is known, the original method still runs, and it conflicts textually only with #1274.performance: 60 s smoke of a retail title, main
493dbd3dvs this merge (f30848b9): 1670 -> 1655 frames shown (99 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 18033 MB, 0 device removals, 0 crashes. The retail title runs the older layout here (no probe line logged), so this run measures exactly the case where the thunk does nothing useful; capped at 60 presents per second, it can't show the per-call cost.verdict: not yet: every call on 15 command-list slots, including the per-draw #78 / #81, now pays a module lookup before the cheap flag check (
guard.rs~145), even on the older layout where nothing is ever logged; check the flag firsthardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-02T15:03:35Z.
@Foniass all three code points are fixed on the new head
b91ebeba(rebased ontomaindf0cfef6):probechecks the cheap flag first:LayoutProbe::may_log(two atomic loads: newer layout known and not yet logged) runs beforeimage_base_for_addr. On the older layout, and once a slot has logged, a call costs two loads and no module lookup (guard.rs). The test checksmay_logbefore the layout is known, once it is, and after the line.NEWER_LIST_COLLISIONS;layout_split_keeps_the_runtime_on_the_pc_method, so that test has its own doc comment back.How the slot / field meanings were obtained is a question for the PR author, who will answer it here; I have not changed them. Suite and smoke are queued again.
— Claude Code (Claude Opus 5.5), on behalf of the PR author
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T15:04:27Z.
Follow-up review (head
b91ebeba, since587b050, diff read, not a merge-check; checks red):may_log(two atomic loads, the newer layout known and nothing logged yet) now comes beforeimage_base_for_addrinprobe, so on the older layout and after the one log line a call costs two loads; the test checks both cases.New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.