startup: image_sample / _l / _lz drop the guest sampler LOD limits, and heap samplers pass unchecked #2169
Closed
opened 2026-11-25 02:56:59 +00:00 by JB2WIN
·
6 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#2169
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 JB2WIN on 2026-11-25T02:56:59Z.
Found while answering the review on #2051.
What happens today (
tools/startup/gfx2hlsl.pyandsrc/startup_stubs/translated_sampler_bindings.h,main):image_sample,image_sample_landimage_sample_lzemit their constant sampler as asmpline. The runtime then builds the desktop sampler withMinLOD = 0andMaxLODunbounded, whatever the guest descriptor's MIN_LOD/MAX_LOD fields say (word 1, bits 11:0 and 23:12, both u4.8; RDNA 2 ISA section 8.2.7, Mesagfx10-rsrc.json).image_sample_calready refuses MAX_LOD ≠ 0. #2051 carries MIN/MAX_LOD forimage_sample_bthrough a newsmplline, and refuses heap or register samplers, a nonzero descriptor bias, mip filter 0 andMIN_LOD > MAX_LOD.Effect. A guest sampler that clamps to a mip level, for example to hide a not-yet-streamed mip, reads a different level on the desktop, with no refusal.
image_sample_lwith an explicit LOD above the guest MAX_LOD is the clearest case.Proposal (one PR, after #2051 lands):
smplforimage_sample,_land_lzas well, so the limits are carried. The bias stays refused unless it is 0, as in #2051.smpline.Which option do you want for point 2?
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T03:09:42Z.
Please take the independently reviewable constant-sampler slice after #2051. Carry the decoded LOD range for
image_sample,_land_lz, use the same validation for unhandled descriptor bias and malformed ranges, and show the three forms independently on WARP and hardware. Each comparison should have distinguishable mip values and a plain-smpcontrol that reads a different level. Use an explicit LOD above MAX_LOD for_l, and a MIN_LOD above the effective starting LOD for the implicit and zero-LOD cases.Keep existing heap/register behavior in this PR so the constant fix does not drop startup pipelines. Log once that these paths still have unvalidated LOD fields, and document the gap. To extend support, first show how the runtime can validate the actual sampler bound at draw time; use one non-default range that proves the dynamic path cannot accidentally fall through to an unconstrained sampler.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T07:04:40Z.
The dependency #2051 is now on main (
71c9c347). The independent Windows Release sampler and adjacent image checks passed 10/10. The existing constant-sampler slice is ready to continue from that base. Reuse the smpl manifest path and keep the three visible-mip discriminators from the earlier review. Runtime heap LOD remains under its separate #2221 claim.Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T13:56:29Z.
Taking this, following the slice in your first comment and the base you named (
71c9c347).Plan, so you can redirect before I write anything:
image_sample,_land_lzemitsmplwith MIN_LOD/MAX_LOD decoded from word 1 (bits 11:0 and 23:12, u4.8), reusing thesmplmanifest path #2051 added forimage_sample_brather than adding a second shape.mip filter 0, andMIN_LOD > MAX_LOD.docs/experiments.mdnext to the form table.smpcontrol that reads a different level —_lwith an explicit LOD above MAX_LOD, and MIN_LOD above the effective starting LOD forimage_sampleand_lz. WARP and the card, with adapter/driver/build in the report.Two things I will state in the PR rather than guess at:
image_sample's implicit LOD needs the gradient path to see the clamp at all, or whether MIN_LOD alone is enough to make the readback differ (I will measure it, and if the clamp is invisible without gradients I will say so instead of claiming a passing discriminator);I will open the PR against
mainand keep it to the three forms;image_sample_candimage_sample_bare untouched.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T13:56:59Z.
Withdrawing my claim above: I checked
mainbefore starting and the slice is already there.tools/startup/gfx2hlsl.pyonmainalready carries the decoded range for these three forms and validates them the way the first comment asked:and
lod_sampler_words()names this issue in its docstring, sharing the bias /mip filter 0/MIN_LOD > MAX_LODrefusals withimage_sample_b.So the constant-sampler work, the log-once for heap and register samplers, and the documented gap are all in
#2265. I should have looked before claiming — my apologies for the notification.What is still open in this issue, as far as I can tell from the code rather than the comments:
smpcontrol — whether they exist as a check I could not tell from the diff alone, and that is the part I would verify next;If you want either of those, say which and I will take it. Otherwise I will leave the issue alone and go back to the operand-arity work (#2360) rather than duplicate
#2265.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T13:59:43Z.
Ran the discriminators on a third adapter: all three forms and all three controls behave as the issue asked
Independent of the author's machine, on
mainat2b30559b, Windows 11 build 26300.9974, DXC 10.0.26100.0,offscreen_checkrebuilt frommain:Per form, WARP (the card prints the same lines; the only difference I saw is the descriptor heap size, 2097152 vs 1000000):
So the two properties the first comment asked for both hold on hardware I did not write this on:
smpcontrol (1 vs 2, 2 vs 1, 1 vs 0), so the discriminator is the sampler range and not something incidental about the scene;Adapter on this machine: NVIDIA GeForce RTX 5080 Laptop GPU, driver 32.0.15.8142. Debug layer enabled for both runs,
debug_errors=0 debug_warnings=0.Controls half, for the record:
With this, the constant-sampler slice of this issue is measured on three adapters (the author's, mine, and WARP on both) and the only part I can see still open is the run-time validation of a sampler actually bound at draw time, which your earlier comment assigns to #2221. Nothing else from my side — my earlier claim on this issue is withdrawn in the comment above.
AI-assisted; the three commands above were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:10:10Z.
Closing the constant-sampler issue after #2265. The independent RTX 5080 Laptop and WARP rerun reproduced all three discriminators: image_sample_l read mip 1 vs 2, image_sample read 2 vs 1, and image_sample_lz read 1 vs 0, each against its plain sampler control. The report has the adapter, driver and debug-layer result: https://github.com/R0Y00/Xbox2Windows/issues/2177#issuecomment-7164593761. Heap entries apply their runtime LOD limits through #2287, with the remaining scope documented in #2330 and tracked in #2221.