runtime: probe an unreadable memory SRV range once per refusal #3466
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3466"
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-11-29T15:29:32Z.
Fixes #3462.
What changes
publish_tiled_texturenow reports through abool& unreadablewhether its readability probe failed.texture_unavailable_reasonuses that result and no longer callsx2w_local::readableon the same range (it also loses itsaddressparameter). All threepublish_tiled_texturecall sites indevice_memory_srvpass the same flag.Faults on an unreadable range, per slot-70 refusal:
main(5de0b114)The 1-byte probe in
log_refused_memory_srvis unchanged; it is the second fault of a logged refusal.Refusal decisions and census names are the same:
texture_no_resource,texture_over_64mib,texture_unreadable,texture_unavailable. The size check still comes before the probe. The census class now follows the probe that made the decision, not a later one.Why
Each failed probe is a first-chance access violation, and under the debugger each one stops the whole process. See #3462.
Tests
tests/startup_memory_srv_diag.cppreserves one page without committing it, sends the same one-texel view to slot 70 twice, and counts read access violations at that address with a vectored handler. It expects 2 faults for the first call (logged) and 1 for the repeat, andtexture_unreadable 2,in the census.tests/startup_memory_srv_diag_check.pyexpects the new shape'stexture_unreadableline after the nine existing slot-70 lines.ctest --preset dev -R '^startup_memory_srv_': 23/23 passed, twice (WARP and hardwarediagincluded).Mutations, each restored afterwards:
d3d12_memory_srv.inlback to the5de0b114version:diag_warpanddiag_hardwarefail withExpected 2 logged and 1 repeat reserved texel probe faults, observed 3 and 2.address_readableforced tofalseinlog_refused_memory_srv): both fail withobserved 1 and 1."texture_unreadable"renamed intexture_unavailable_cause(run on the first commit,62e0a3c1):startup_memory_srv_censusfails.Not covered
publish_tiled_texture, so whichever merges second gets a textual conflict there. There is no semantic overlap: #2245 does not touchtexture_unavailable_reason.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T08:56:47Z.
Review: APPROVED
Reviewed
5ca1d954by reading the diff; not built or run.Verdict: approve. One fault fewer per refusal, and the census class is unchanged on every path. No MUST.
d3d12_memory_srv.inl:768-792): withpublishedtrue,texture_unavailable_reasonruns only when there is no texture and nothing isheld. On the BC / bc64 path,publish_tiled_texturehas just run. On the console-layout path, the only way through withoutheldis theelse if (!texture)branch, which also callspublish_tiled_texture. Sounreadableis always the result of a probe on the same call, never the stalefalsedefault. A view with both a BC and a console layout probes twice, and the second result wins, which is the correct one.unreadable = false, sotexture_over_64mibis unchanged. Anullptrafter a successful probe still givestexture_unavailable.2e30cc59).readablegoes throughprobe_readable→mapped_prefix, which skips onlyMEM_FREE. AMEM_RESERVEpage is still touched with the pre-check on or off (X2W_PROBE_PRECHECK, #3313), so the expected 2 / 1 faults do not depend on the debugger or the environment. Neither file has changed on main since this head.Tests: the vectored-handler count at the exact address shows the probe count per call, and the
5de0b114mutation (3 / 2) shows it catches the double probe. Thediag_check.pychange follows the new tenth slot-70 line. CI did not runstartup_memory_srv_diag_*: they are not in theprpreset's list, and/O2was skipped on the PR.