runtime: make the coherent placed buffer refresh opt-in #3914
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3914"
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 R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T07:54:23Z.
Problem
Since #3776, a translated draw input or a compute root SRV in a placed buffer that does not alias guest memory is refreshed from guest memory through
refresh_range. Two things changed with it.Full-length application runs stall. Since #3776, every full run stalls when it reaches a later, heavier scene: the presenter reports
x2w-present fence wait exceeded 2 seconds, and the process is ended about 30 s later. Bisection shows the stall needs the refreshed bytes themselves:So the copy cost and the fence handling are not the cause. The buffers involved are consumed as constant buffers. The likely cause is a translated shader doing unbounded work once it reads real constants. That is not confirmed and is still under investigation.
Refusal controls fail on
main. These tests expect a refusal for an input that is now refreshed:startup_compute_dispatch_input_{warp,hardware},startup_compute_input_view_token_{warp,hardware},startup_compute_root_srv_dispatch_{warp,hardware},startup_compute_snapshot_order_{warp,hardware}startup_indirect_translated_draw_{warp,hardware},startup_indirect_translated_refusal_census_{warp,hardware},startup_indirect_translated_refusal_census_control_warp. #3890 addresses these in a different way.Change
This is a temporary gate, not a revert. All of #3776 stays in the tree and can be enabled per run.
X2W_COHERENT_PLACED_REFRESH=1turns the refresh on. The switch is read once per process. With it on, behaviour is the same as currentmain.indirect_table_bufferandcompute_root_srv_bufferdo not call the refresh. They refuse these inputs with the same refusal text as before #3776. The two refusal reasons that #3776 added appear only with the switch on.before_submit/commit_lists,mark_gpu_writtenon copies and the triage reasons are unchanged.startup_coherent_placed_srv_{warp,hardware}now set the switch. A new test,startup_coherent_placed_srv_switch_off, runs with the switch off and checks that the gate reads off.docs/startup-runtime.mdhas a new row in the switch table.Once the stall is understood, the default can go back to on and the switch can be removed.
Validation
Windows, MSVC, on WARP and on a hardware adapter.
Targeted tests: 29/29 passed.
startup_coherent_placed_srv_{warp,hardware}with the switch onstartup_coherent_placed_srv_switch_off, the new controlmainmainstartup_mesh86_material_backing*standin_exports,compat_report,triage_runIndependent read of the diff. With the switch unset, every path that #3776 touched behaves as it did before #3776, with identical refusal text. With
X2W_COHERENT_PLACED_REFRESH=1, behaviour is the current one.Full-length application runs.
mainNotes
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T08:05:26Z.
Review: APPROVED
Independently reviewed
9af44a3f. Both production refresh_range callers are gated and the alias and copy-backed cases are preserved. Windows 11 build 26300, MSVC Debug: all 16 source-built cases passed, including 13 affected indirect and compute tests with the flag unset, both enabled refresh fixtures, and the explicit switch-off control. No skips, using WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. With identical binaries and X2W_COHERENT_PLACED_REFRESH=1, both refusal-census cases reproduced the key3 mismatch: pixel (0,0) got 0xff00ff00, expected 0xff000000. #3890 tracks the opt-in case. The original executable comparison remains the author's work.