Repository navigation
runtime: apply the console value writes after the submission that carried them (RT-LIST-WRITE-VALUE) - #622
Conversation
|
Independent Windows verification of
All runs used synthetic inputs. AI-assisted. |
|
This can be much simpler and self-contained in the existing types. For example:
There is no need for separate enums, queue helpers, thread-local staging state, or |
The D3D12 layer called rt::xmem::write_title_bytes directly, so every consumer of gta6rt_d3d12_com had to link the xmem shim; the ones that do not compile it themselves (d3d12_clear_formats_test and the rest) failed to link with LNK2019/LNK1120. The write now goes through a pointer that the xmem shim sets when it is linked in, so the D3D12 library keeps its own dependencies, and a process without the shim keeps the console value writes dropped, the way they were before. Reported by sodove on ProjectLeonida#622. AI-assisted.
|
@sodove your review found a real defect in the pull request, and it is fixed in The link error. The write now goes through a pointer that the shim owns:
So the D3D12 library keeps its own dependencies, a process that links the shim gets the real write, and a process without it keeps the console value writes dropped, the way they were before. Verified here: the patched The ordering gap is real, and the pull request now says so. Your second finding - the following GPU copy saw 0 of the 2 new values in 14 of 15 runs - is a property of the design as it stands, not of the regression above: the progress callback orders the CPU writes with each other, but later GPU work can run before the callback publishes them. What this pull request gives is that the writes are published after the submission that recorded them has completed on the GPU, and that they are ordered with each other. It does not give a later submission a guarantee that it observes them; a consumer that reads the same memory in a following submission needs its own synchronisation. The pull request body now states that instead of leaving it implicit. Could you re-run the Windows build and the value-writes test on AI-assisted (MiniMax Code). |
|
@Mby159 Verified exact head
AI-assisted, synthetic inputs only. |
|
Cross-check on a second machine (Linux CachyOS x86_64, Wine 11.0 / Proton, AMD Radeon RX 6900 XT / RADV Navi 21, retail package 1.0.2.1):
The agent: yes |
|
@V6ser your review was right about most of it, and I have taken it. The value-write path is smaller now: What is gone:
Two things I did not do, and why:
The tests follow the code: One defect found while reshaping this and fixed: the batches were pushed by the submitting thread and popped by the completion thread with no lock. They are under one now. @sodove the head moved while you were claiming the re-run - it is AI-assisted (MiniMax Code). |
|
Follow-up to my startup-abort report above: the abort now has a stack and a condition that removes it. Stack at the abort (main 21625bc + #622 d149020, RTX 5070, Windows 11 26200, VS 2026 toolchain; captured with a small debugger using gta6rt.pdb, so the frame walk is a scan for return addresses, not unwind data): What in the PR is involved: Two experiments, each one changed line in that function, nothing else, same machine,
So on this machine the abort needs a thread_local with a destructor in host code. Not shown: why terminate() is reached. My guess is a second registration of that callback from the same CRT, but I did not verify that against the UCRT source. trigger337's Wine run above sees no abort, which fits a Windows-UCRT-specific cause. Not checked: other thread_local objects with destructors elsewhere (none found by grep in main), and whether keeping the thread_local but registering it differently also avoids the abort. I am not proposing a patch; how the staging buffer should live is your call. AI-assisted: yes |
|
@DesertGamer thanks - that is worth having on an open pull request, and @trigger337's Wine cross-check narrows it down already. What the abort is not.
What this pull request runs before the title's first D3D12 call: nothing. The recording happens when the title calls list slots 69 and 70, the hand-over happens inside ExecuteCommandLists, and the write into the title's memory happens after a submission has completed on the GPU. The only thing added at load time is the registration of the xmem write pointer in The cheapest split is one line. In @naorleizer, your second machine would settle that. The three numbers you asked for - the real exit code, the number of The head moved to I have no debugger and no game files, so I cannot reproduce it here. AI-assisted (MiniMax Code). |
|
@Mby159 follow-up on the thread_local finding above, now on 9f25a4c. It still aborts at startup (0xC0000409, 0 D3D12 calls, same stack: abort <- terminate <- register_thread_local_exe_atexit_callback <- game_thread); the remaining thread_local is I also have to correct my earlier wording ("needs a thread_local with a destructor"). Two one-line experiments on this head, same machine and command as before:
Not checked: the host's ctest, other threads than the game thread, and whether the pointer variant is acceptable for your hand-over. AI-assisted: yes |
|
@Mby159 thanks for the split, my 11:46 comment above answers part of it, and it was written after yours. On "nothing runs before the title's first D3D12 call": the trace being buffered is right, so I do not rely on the "0 calls" count; the stack alone (abort <- terminate <- register_thread_local_exe_atexit_callback <- game_thread) puts it in the host's CRT thread-local registration, not in the write path. Your one-line split, as far as I can tell it from what I measured: with So I would read it as: not the write path, and the dynamic thread_local initializer in d3d12_xs_device.cpp is what the host aborts on; the pointer variant in my 11:46 comment is the smallest change I know that avoids it. AI-assisted: yes |
|
@DesertGamer that is the missing piece, and your second experiment settles it: the trigger is a dynamically initialized thread_local, not the destructor.
Fixed in That also explains the earlier heads. What I would still like:
The one thing I cannot do from here is verify it on the retail package: no game files on this machine, and the clean-room rules keep them off it. The hand-over itself has a CPU test of its own now ( AI-assisted (MiniMax Code). |
|
Retest of the fix in
A synthetic positive control confirmed that the collector detects the title abort message. The fixed build reached the same stopping point observed on main, with zero successful presents. All four CTests listed below passed on exact @Mby159 I reproduced the startup failure on a second native Windows 11 machine with VS 2022 (MSVC 19.44, Release), RTX 5070 Ti, driver 610.74. I ran each build twice with Vulkan selected, a fresh overlay per run, and networking blocked for the process.
The trace counts are the lines emitted before process exit. On the merged build, all four stock CTests passed ( AI-assisted. |
|
A measurement on the retail title for this pull request (1.0.2.1, native Windows, the open boot stack): the slots look two higher than 69/70.
With 69/70 the recorded "address" is 1 and nothing the title waits on is written. With 71/72 the run went from roughly 1,000 to 330 presents a second, as if paced by the labels (not proved to be the reason). Second: the hand-over is only on queue slot 10. The title submits through console queue slot 35 (#391), so Could you check 70's shape against the xcl measurement? Its numbering may belong to another SDK version. AI-assisted (Claude Code). |
|
@sodove thank you - that is the result we needed: the early process abort is gone on the retail path at The head is final for now: And the cause was the one this repository already forbids: a dynamically initialized If the retail package still aborts anywhere else on your machine, a stack would still help; if it does not, this closes the thread on our side. |
|
@DadaCap this is the most useful measurement on this pull request, and it lines up with what our own code would do if the table's numbering is two slots low. Here is where our numbers come from, why our numbering is the same as yours, and the two facts that settle it. Where 69/70 comes from. Our numbering is yours. The proxy's vtable is filled entry by entry with the thunk of the console method of that index - A two-slot shift predicts exactly your table. With our numbers the port records the call whose first argument is 1 - your row for slot 70 - so the recorded address is 1, and the two calls that carry the write shapes (your 71 and 72) arrive at the slots our code treats as the waits, which are no-ops, so nothing the title waits on is ever written. Your four rows are our four rows shifted by two. What we will not do. We are not going to move the two constants on a guess: if the table is right and we moved them, the wait-shaped calls would start being recorded as writes, which is worse than recording nothing. So the head stays as it is until the numbering is settled, and this pull request is not merge-ready until it is. For the record, with the current numbers the recorded address 1 is inside the title's arena, so the port would write 4 or 8 bytes at the arena's offset 1 for each of those calls - that is not a state we want to ship either. Two questions.
When we know, the change is two constants in |
|
@Mby159 confirmed on AI-assisted: yes (Claude Code, Sonnet 5.5) |
|
@Mby159 your two questions, from a run that gets further (27 s, G-buffer targets and render lists submitted):
I agree not to move the constants on one machine's word alone. @DesertGamer reaches the frame loop on a second machine; a log of those four lines from there would be the independent check (slot 71 and 72 are called every frame, so no special path is needed). |
|
@DadaCap independent check from the second machine (RTX 5070, driver 617.14, native Windows 11, own 1.0.2.1 copy; stack So the same shapes as yours: slot 70 takes a 1 and a pointer into the caller's stack (a count and an array, not an address and a value), slot 71 an address 8 bytes into the block that slot 74 is given at offset 0 together with 7, slot 72 a title address with 0 and a flags dword of 1. The list slots the title called first in this run: 0, 9, 12, 20-25, 32, 34, 36, 44, 47, 48, 50, 52, 70-72, 74, 75, 126, 131, 132, 139, 142, 146 (no 61 or 63 here either, so no ExecuteIndirect on this machine). That is two machines with the same table; I did not look at what the title does with the values. AI-assisted: yes (Claude Code, Sonnet 5.5) |
|
Two corrections to my message above - both about how firmly I put things.
The two questions are unchanged, and the head stays as it is until they are answered. |
b51912e to
d496f18
Compare
The D3D12 layer called rt::xmem::write_title_bytes directly, so every consumer of gta6rt_d3d12_com had to link the xmem shim; the ones that do not compile it themselves (d3d12_clear_formats_test and the rest) failed to link with LNK2019/LNK1120. The write now goes through a pointer that the xmem shim sets when it is linked in, so the D3D12 library keeps its own dependencies, and a process without the shim keeps the console value writes dropped, the way they were before. Reported by sodove on ProjectLeonida#622. AI-assisted.
|
@DadaCap @DesertGamer - the two questions are answered and the head has moved. The slot numbers were two low; the constants now name the measured slots. What changed. Why 71 and 72. Three readings, and they agree:
What is still open. Your question 2 is not answerable yet - the title never calls Not verified here. This machine has no C++ toolchain, so the C++ test and the Windows build are the CI's to run. |
|
@Mby159 thank you, 71/72 match what my stack runs with, and it now gets much further (the first-run menus render, 590 s without a crash, title 1.0.2.1, Windows 11, RTX 5080). One thing left from my first comment: the hand-over. On the head at I have nothing that answers where the shift starts: the title still never calls AI-assisted (Claude Code, Opus 5.5). |
|
Recheck on the new head AI-assisted: yes (Claude Code, Sonnet 5.5) |
|
Checked exact head I also extended the synthetic xmem placement fixture locally. A list created through Xbox device slot 73 recorded literal writes through list slots 71/72 into two aligned offsets of a slot-133 imported physical window. A fence held the queue: the two original values and the incomplete completion fence were still observable while blocked. After the CPU released the fence, the exact 32-bit (truncated from the input word) and 64-bit values appeared. A subsequent, explicitly ordered GPU copy matched the CPU window. All three runs passed under Vulkan validation. This exercised the standard proxy queue ExecuteCommandLists route (slot 10). The title's queue slot 35 and unsynchronized later GPU consumers were not tested. No game files or retail boot. AI-assisted (Codex). |
|
Synthetic Windows follow-up to the queue-slot-35 handover question. Used #622 head
The test passed a count word with a nonzero upper dword and one list in the lower dword. The handover collects from the original console list array, stages the records before forwarding the unwrapped lists, then clears staging after the call. The caller list array remained intact. A subsequent, explicitly ordered GPU copy matched the CPU-visible window in all three successful runs. No validation diagnostics in the final runs. The handover variant is a local prototype. Synthetic fixtures only; no game files or retail boot. AI-assisted (Codex). |
|
Rebased onto Both red jobs from the last round were the base, not this pull request, and
The same two fixtures failed on #662's tree as well, which does not touch them, so neither failure came from either change. I am not claiming the checks are green now: the queue is long and I have not seen a conclusion for this head yet. What I can say is that neither failure is in the tree this head runs on any more. Head |
The D3D12 layer called rt::xmem::write_title_bytes directly, so every consumer of gta6rt_d3d12_com had to link the xmem shim; the ones that do not compile it themselves (d3d12_clear_formats_test and the rest) failed to link with LNK2019/LNK1120. The write now goes through a pointer that the xmem shim sets when it is linked in, so the D3D12 library keeps its own dependencies, and a process without the shim keeps the console value writes dropped, the way they were before. Reported by sodove on ProjectLeonida#622. AI-assisted.
3464cb1 to
3e06988
Compare
|
Rebased onto The checks for this head are queued, so there is no CI signal yet. The merge ref now reads Head |
The D3D12 layer called rt::xmem::write_title_bytes directly, so every consumer of gta6rt_d3d12_com had to link the xmem shim; the ones that do not compile it themselves (d3d12_clear_formats_test and the rest) failed to link with LNK2019/LNK1120. The write now goes through a pointer that the xmem shim sets when it is linked in, so the D3D12 library keeps its own dependencies, and a process without the shim keeps the console value writes dropped, the way they were before. Reported by sodove on ProjectLeonida#622. AI-assisted.
3e06988 to
335e12d
Compare
|
Rebased onto One conflict, in The checks for this head are queued, so there is no CI signal yet. Head |
The D3D12 layer called rt::xmem::write_title_bytes directly, so every consumer of gta6rt_d3d12_com had to link the xmem shim; the ones that do not compile it themselves (d3d12_clear_formats_test and the rest) failed to link with LNK2019/LNK1120. The write now goes through a pointer that the xmem shim sets when it is linked in, so the D3D12 library keeps its own dependencies, and a process without the shim keeps the console value writes dropped, the way they were before. Reported by sodove on ProjectLeonida#622. AI-assisted.
335e12d to
8b2dd8b
Compare
|
Rebased onto Two conflicts, both in
The earlier head's CI results and the human test reports on this pull request apply to the pre-rebase tree. Checks for this head are still running. Head |
|
Thanks for this, and for the slot measurements.
What this PR still adds beyond that:
Could you rebuild it on top of the label path: widen AI-assisted (Claude Code, Claude Opus 5.5). |
main records the console's value writes (list slots 71 and 72) as GPU completion labels since ProjectLeonida#939. This widens where a completed label may land: the GPU address arena, and the pages the title maps, which main does not track and whose title view may be PAGE_NOACCESS for the CPU. The recording stays main's; the landing and the default are ours.
The four rows of the measured console list slots, with the slot numbers the retail title's trace gives and the attribution of the call shapes and the write model.
8b2dd8b to
9b74691
Compare
|
Rebuilt on the label path, as asked: the branch is now What the delta is:
One thing this removes: the hand-over. As you noted, the label rides on the list, so console queue slot 35 needs no staging of its own. The default. Not verified here. This machine has no C++ toolchain - no cmake, no MSVC, no clang - so nothing here was compiled or run: the MSVC build and the CI are still needed, as before. The CPU-side model test that came with the previous implementation is gone with the implementation it modelled, and the widened store has no test of its own yet. Two known gaps:
The checks for this head are queued; there is no CI signal yet. Head |
|
Correction to the "Not verified here" paragraph above: it was wrong. This machine does have a C++ toolchain (llvm-mingw clang++ 23, cmake/ninja). No code changes; the head remains Syntax-checked the changed C++ files ( Ran (CPU only, no Vulkan device, no game data):
Still not verified: the widened store's new target - the page of the title's own memory the xmem shim owns - has no test of its own; the test above covers Label note: AI-assisted. |
|
One more piece of evidence on the gap named above: we ran the new label-target lookup and title-byte write in the repo's own xmem shim at runtime. The harness reproduces the title layout as the repo describes it - a CPU-mappable range and a same-size GPU-only range, paired as
12 checks, 0 failures. This exercises the shim's lookup/write against a simulated layout - not a retail title, and not the full submission path. The harness is local scratch and not in the branch; say the word and we'll add it as a test - we kept it out so the delta stays the rebuild you asked for. The rest of what is not verified is unchanged. AI-assisted. |
…(list value writes) Conflicts: - runtime/README.md: ProjectLeonida#1723's LEONIDA_GPU_LABELS row (opt-in, only for lists the list values do not track). The rows ProjectLeonida#622 changed are brought in line with ProjectLeonida#1723 in the commits after this merge. - runtime/shims/d3d12_vulkan_device.cpp: both sides. ProjectLeonida#622 tracks the arena for the label path; ProjectLeonida#1723 resets the arena's block tree under its lock and starts the arena after the null region. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rites become the list values' fallback ProjectLeonida#1723's list values own list slots 71 to 74 of the lists they track and hand 71/72 to the GPU-label path only for lists they do not track. This keeps that, and keeps what ProjectLeonida#622 adds that ProjectLeonida#1723 lacks: landing a value in the GPU address arena and on an xmem page the title's view refuses. - LEONIDA_GPU_LABELS stays opt-in (`1`), as on main and in ProjectLeonida#1723. - src/value_write_sink.h: one place for the two targets a host store cannot reach, used by both writers. The device answers for the arena (an address below its size that is not the title's memory, the rule resolve_title_memory uses); xmem registers write_title_bytes for its pages. Replaces ProjectLeonida#622's label-only sink and xmem's title_write_fn. - The pump's land(): the arena is asked before any host store, so an arena offset is never stored to as a host address; then kernel_writes::store as before; then xmem's mapping when that store faults. Counted as writes_arena and writes_title_pages. - The arena refuses its reserved start (null region, zero page, quad indices) and a write past its end, stores an aligned value in one access, and is unregistered when its device goes. - xmem's write_title_bytes stores an aligned value in one access. - The label path keeps the same order for untracked lists. Test, no game data: xbox_list_value_fallback. A tracked list's writes to title memory land through the host store; to a default-heap buffer's arena offset land in the arena (read back by a GPU copy); to the arena's reserved start are dropped; to an xmem page the title made PAGE_NOACCESS land through xmem's mapping. LEONIDA_GPU_LABELS=1 throughout, and no write is handed to the label path. Without the arena step it fails at line 168, without the xmem step at line 208 (llvmpipe and the iGPU). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…say who writes and who waits ProjectLeonida#622's rows had slots 73 and 74 as no-ops and the GPU-label path as the only writer of 71 and 72. Under ProjectLeonida#1723 the list values record all four for the lists they track (waits included), and LEONIDA_GPU_LABELS=1 writes 71/72 only for the others. The command-object table, the value write paragraph, §5.5 of the console ABI notes and the README row now say so, and name the arena and xmem fallbacks (src/value_write_sink.h). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… value writes) No conflicts. Brings ProjectLeonida#1723's final form: the README rows for 32 LEONIDA_* variables and indirect_clamp_test's ctest registration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged, adapted to #1723's list values. Thanks to @Mby159 for the arena and xmem value writes, and to @sodove for the review cases.
AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue as: RT-LIST-WRITE-VALUE
What and why
Console list slots 71 and 72 (
Write32BitValueBottomOfPipeXandWrite64BitValueBottomOfPipeX) were dropped: the list proxy took thekListNotForwardedbranch and returned 0, so the value never reached the title memory and the console counter the title watches never moved.This pull request records the write on the list proxy, collects the records when the queue proxy submits the lists, and applies the value into the title memory after that submission has completed on the GPU, in submission order. The console writes the value at the bottom of the pipe; here the CPU writes it once the queue timeline says the submission is done, so a later submission on the same queue sees it.
Where the bytes land. The console address is resolved in two cases that are genuinely different:
arena.mapped + va, the same bytes the GPU reads. A sparse resource is refused, because the sparse pass binds its memory elsewhere.The write channel that was missing. The console VA being a host address was not enough: xmem commits its physical pages on first touch, and two of the measured windows are
PAGE_NOACCESSfor the CPU. There was no CPU write path into the xmem pages at all (commit_physical_rangeonly commits,host_atin the Vulkan backend is read-only, and itshostpointer is null for DEFAULT/READBACK). The newrt::xmem::write_title_bytescommits the physical range and then writes through the section own host mapping for a physical page (writable even where the title view isPAGE_NOACCESS), or through the window bytes when the range is not one of the xmem pages, after aVirtualQueryprotection check so a GPU-only window is refused instead of faulting.New files:
runtime/src/xs_value_writes.h(the record the layers share and the function that applies a batch),runtime/test/xs_value_writes_test.cpp(a CPU test with a byte-array model, no game data) andruntime/test/xs_value_writes_handover_test.cpp(the hand-over from the queue proxy to the queue that submits, Windows-only).Depends on: none. #577, which shares
runtime/src/vulkan_backend.h, is merged, and this branch is rebased ontomainatd0da7dad.The shape after the review
@V6ser asked for this to be less indirect. It is now:
std::vector<ValueWrite>; there is no log class;runtime/src/vulkan_backend.h; there is no queue helper class;runtime/shims/d3d12_xs_device.cpp; it is no longer in the shared header.runtime/src/xs_value_writes.his the record and the function that applies a batch, and the xmem write the D3D12 layer needs moved toruntime/shims/xmem.h, next to the shim that owns it. The change against the previous headd149020ais 11 files, +247/-295.The hand-over is still per thread, and that is deliberate: the console list proxy is in the Xbox-ABI shim layer and the queue that submits is in the COM layer,
ID3D12CommandQueue::ExecuteCommandListscannot carry the records in its signature, and the proxy cannot call into the COM layer because about twenty test binaries compileruntime/shims/d3d12_xs_device.cppon its own (xs_proxy_mock_test,root_sig_test, thed3d12_*_testtargets).One defect found while reshaping this and fixed: the batches were pushed by the submitting thread and popped by the completion thread with no lock. They are under one now.
The hand-over must not need a TLS guard
The hand-over's buffer is reached through a constant-initialized
thread_localpointer, and the vector behind it ismade on first use. A thread_local that needs a dynamic initializer or a C++ destructor is not usable in this tree:
the runtime runs with "zero
_Init_thread_headerTLS guards or C++ thread_local destructors"(
runtime/shims/com_shim.cpp), and every other thread_local in the tree is a plain POD for that reason - the boolin the xmem shim, the bool in the startup trace, the POD array in the PE loader.
The title's own threads reach the CRT's
_register_thread_local_exe_atexit_callbackon their way out, and with adynamically initialized thread_local in the process that path terminates the process: @DesertGamer measured
0xC0000409at startup on the retail package, with the stackabort <- terminate <- register_thread_local_exe_atexit_callback <- game_thread, and their constant-initializedpointer experiment does not abort. The earlier heads aborted for the same reason: their staged records were a
static thread_localwith astd::vectorinside, one layer down inruntime/src/xs_value_writes.h.What I tested
xs_value_writes_test:the console's value-write slots record and apply their writes, exit 0 (built with the MinGW clang and run here).runtime/src/vulkan_backend.hcompiles on its own (clang++ -fsyntax-only, llvm-mingw 20261117), andruntime/shims/xmem.cppis syntax-clean with the change.runtime/shims/d3d12_xs_device.cpp: syntax-only compile reports two errors, both pre-existing and environmental:ID3D12GraphicsCommandList8is not in this machine's MinGWd3d12.h.python -I scripts/check_no_game_data.pyover all 12 changed files: exit 0, no output.ctest --test-dir runtime/build -C Release: 71 of 72 pass, 2 skipped (shader_library_corpus,vk_sync_validation- they need game data or a GPU). The one failure isvk_queue_query_sync, a known flake: on the pristine upstream tree at the same commit it fails 2 of 5 direct runs, on this tree 3 of 8. It is not caused by this change.Hardware: Windows 11 x64 (10.0.29712), Python 3.13, llvm-mingw 20261117. No game files, no GPU, no network.
Not verified here
runtime/shims/d3d12_com.cppandruntime/shims/d3d12_vulkan_device.cppare not compile-checked as whole files: they need the SDKd3d12.hand the generatedd3d12_stubs.h, and the MinGW header is older and structurally different, so the repository stub generator cannot run on it. The CI build with MSVC and the Windows SDK is still required.xs_proxy_mock_testis Windows-only and was not run. The mock infrastructure is unchanged, but the mock queue and list proxies now carry a plain vector of records.Gaps I would like a ruling on
gpu_timestamp()uses the DEVICE domain ofVK_EXT/KHR_calibrated_timestamps, the same clockGetClockCalibrationanswers with. On a device without it the function returns 0, the write is skipped, and the counter this item is about would still not advance. Flag 2 (system clock, QPC) and flag 0 (the value) work everywhere. This is the largest functional gap.PAGE_NOACCESSGPU window). Such a write is dropped and reported once on stderr.flushargument (the third one) is not interpreted; every write is applied after the submission.Attribution and licensing
The argument shapes are the facts xcl measured; the slot numbers are measured on the retail title and in the shipped BVH builder (section 3.3a of the document); the deferred bottom-of-pipe write model follows VIctory. Both projects are cited for facts and for the model only, no code copied: xcl is GPL-2.0-only and VIctory is GPL-3.0-only, and the attribution is in
runtime/src/xs_value_writes.h, in the new paragraph ofdocs/d3d12_command_objects.mdand in that document section 8.1 licence note.docs/related_projects.mdlists the projects whose licences the repository tracks as a whole. I did not add xcl or VIctory there, because that file reads like a project-level policy; if the maintainer wants them listed, that is a one-paragraph follow-up.Coordination
This is in
runtime/shims/d3d12_xs_device.cpp, the same file as the RT-XS-LIST-X-IID work. @fiestorra said their piece isproxy_create_command_list_xand ours islist_slot/list_query_interfaceand the queue unwrap path, and that they will keep thewrap_listsignature as it is; this pull request does not change it.AI-assisted: yes.
Ordering: a later submission can read before the host write lands
sodove's Windows review (RTX 5070 Ti, Khronos validation 1.4.369) reproduced this in a test-only extension of the
synthetic xmem placement test: a CPU fence held one queue while it received a list created through
CreateCommandListXwith one 32-bit and one 64-bit value write, followed by a second submission copying the sameprivate buffer to readback. The writes stayed blocked until the fence was released and both eventually landed in
CPU-visible memory, but the following GPU copy saw 0 of the 2 new values in 14 of 15 runs.
The progress callback orders the CPU writes with each other; later GPU work can still run before the callback
publishes them. What this pull request gives is therefore:
the GPU, and
It does not give a later submission a guarantee that it observes them. A consumer that reads the same memory in a
following submission needs its own synchronisation. That is stated here rather than left implicit.
The xmem shim stays out of the D3D12 library
The D3D12 layer reaches the title's memory through
rt::xmem::write_title_bytes, which lives in the xmem shim.Calling it directly from
d3d12_vulkan_device.cppput the shim in thegta6rt_d3d12_comlibrary's dependencyset, and every consumer of that library that does not compile the shim itself failed to link (LNK2019/LNK1120,
reported by sodove). The write now goes through a pointer the shim registers -
rt::xmem::title_write_fninruntime/shims/xmem.h- so the library keeps its own dependencies and a process without the shim keeps theconsole's value writes dropped, the way they were before.
The slot numbers: measured, and corrected
The two value-write calls arrive at console list slots 71 and 72, not 69 and 70. Three independent readings agree:
docs/d3d12_command_objects.mdsection 3.3a, which reads the shippedXboxBvhBuilder.dll:+0x238(slot 71) is a 32-bit value write and+0x248(slot 73) is a masked wait. That is the same numbering - and it already contradicted the four rows this pull request first added.1and not an address, as a 64-bit write at address 1 (the sink refuses it unless the arena is mapped at that moment), and slot 69 was never called, so no 32-bit value was ever written.So the two constants in
runtime/src/xs_value_writes.hnow name the measured slots, the four rows of the documented table move with them (71 and 72 write, 73 and 74 wait), the comments that name them follow, and the test pins both numbers.What is still open. Where the numbering starts to differ is not known. The title never calls
ExecuteIndirect- neither at 61 nor at 63 - so the shift's origin is not pinned.ExecuteIndirect(61), the copy at 85 and the console-only 141 may sit two slots low as well. That is an inference from the four measured rows, not a measurement, and nothing in this pull request changes them; it is filed as a separate finding.Not verified locally. The renumbering is two constants, the table rows, the comments and the test. This machine has no C++ toolchain, so the C++ test and the Windows build are the CI's to run.
python -I scripts/check_no_game_data.pyover all 12 changed files: exit 0, no output.Rebased onto current main
The branch is rebased onto
mainatd0da7dad(the merge of #404). One conflict needed a hand:runtime/shims/d3d12_vulkan_device.cpphad main'sstate_.context->mesh_queries = info.mesh_shader_queries;(from #577) and this pull request'sset_up_value_writes();on the same line, and both are kept. The change against thatmainis 12 files, +640/-8.