Repository navigation
runtime: probe an unreadable memory SRV range once per refusal - #3466
Merged
Merged
Conversation
This was referenced Nov 29, 2026
lukaslw-lab
approved these changes
Nov 30, 2026
lukaslw-lab
left a comment
Contributor
There was a problem hiding this comment.
Reviewed 5ca1d954 by 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.
- Census on the shared path (
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. - Order is kept: the 64 MiB check still returns before the probe with
unreadable = false, sotexture_over_64mibis unchanged. Anullptrafter a successful probe still givestexture_unavailable. - The fixture holds on current main (
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 5de0b114 mutation (3 / 2) shows it catches the double probe. The diag_check.py change follows the new tenth slot-70 line. CI did not run startup_memory_srv_diag_*: they are not in the pr preset's list, and /O2 was skipped on the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: startup: stop probing unmapped guest memory from the texture and no-op paths #2245 does not touchtexture_unavailable_reason.