runtime: make the coherent placed buffer refresh opt-in #3916
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3916
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Leyukaka on GitHub · 2026-12-03 07:54 UTC · original
Leyukaka:coherent-placed-refresh-optin→main· +36 −1 · 6 files · 1 commits · merged 2026-12-03 08:06 UTCProblem
Since #3778, 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 #3778, 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. #3892 addresses these in a different way.Change
This is a temporary gate, not a revert. All of #3778 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 #3778. The two refusal reasons that #3778 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 #3778 touched behaves as it did before #3778, with identical refusal text. With
X2W_COHERENT_PLACED_REFRESH=1, behaviour is the current one.Full-length application runs.
mainNotes
@R0Y00 on GitHub · 2026-12-03 08:05 UTC · original · approved these changes
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. #3892 tracks the opt-in case. The original executable comparison remains the author's work.