Repository navigation
Conversation
|
Review of |
f483624 to
82117f0
Compare
|
Thanks for this. I reviewed head Two things need fixing before this can land:
Non-blocking:
Environment: Linux, git objects, a trial merge and pure-Python probes only. I did no build, WARP or GPU run. This comment was AI-assisted. |
82117f0 to
876bb21
Compare
|
Thanks for the review. The head is now
Rerun on the RTX 4090 (driver 32.0.16.1088, Debug, debug layer on), 12 tests selected: 11 passed, 1 capability skip ( On the non-blocking points:
AI-assisted. |
translate_compute_natively refused every program with a sampler. The C++ compiler already resolves constant sampler words into ComputeSampler entries, so they now fill the route's TranslatedSamplers in register order and the existing root signature code creates the static samplers: a comparison sampler as smpc, any other with explicit_lod as smpl, the choice format_graphics_runtime_manifest makes. A comparison sample's 2D texture (comparison_texture_srv) binds like a plain texture input. A refused native translation clears the samplers so a published manifest read next numbers its sampler lines from 0. A natively bound 2D texture input now sets slot.srv_dimension. The dispatch path treats any other value as a described 1D, 2D-array or 3D view and refused the input as "not 3D". Sampler words that are not constants (a sampler read from memory) are refused by the compiler before this code runs, so the route itself no longer has a sampler refusal; the capacity message drops that clause. startup_compute_dispatch_native_check.py gains step 5: four samples of a two-mip 2x1 R32_FLOAT texture (new consumer mode texture-volume-native-sampled) through four constant samplers: wrap, mirror under a MAX_LOD clamp, clamp under a MIN_LOD clamp, and a LESS comparison. Every stored word is compared with a CPU model of the sampler words. A sampler loaded from the table stays refused with the volume untouched. Refs R0Y00#3149 AI-assisted. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
docs/experiments/startup-compute-native-samplers.md describes what translate_compute_natively binds for a constant sampler, the four-sampler fixture and its memory sampler control, the hardware results on an RTX 4090, the WARP capability skip and six mutations of the change. docs/startup-runtime.md and the route note no longer list every sampler among the refusals. Refs R0Y00#3149 AI-assisted. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
876bb21 to
9358244
Compare
|
Update: the head is now #3241 rewrote the binding loop in One thing came out of that: on Rerun on the RTX 4090 (driver 32.0.16.1088, Debug, debug layer on), 11 tests selected: 10 passed, 1 capability skip ( The AI-assisted. |
Change
Target branch
main. Fixes #3149. Part of #2935 (item "Samplers") and #3074 (stage 5). Follow-up to #3075 / #3083, which covers the published-manifest route.No longer depends on #3049. Since #3241,
mainitself accepts a 2D texture input and a 3D float texture output on the in-process route, which is all this fixture needs. The branch is now two commits onmainatf5a6f6ba(af6045dfchange and fixture,93582447docs). The earlier heads (f4836244,82117f07,876bb210) were stacked on #3049.With
X2W_NATIVE_SHADERSset,translate_compute_natively(src/startup_stubs/d3d12_compute_dispatch.inl) refuses every program with a sampler, so a natively translated compute program that samples falls back togfx2hlsl.py. The C++ compiler already resolves a sampler whose four words are constants into aComputeSampler. This change binds them:program.samplersfills the route'sTranslatedSamplersin register order, and the existingcreate_translated_root/decode_staticscreate the static samplers. A comparison sampler is bound assmpc; any other withexplicit_lodassmpl, with the descriptor's MIN_LOD and MAX_LOD. This is the choiceformat_graphics_runtime_manifestmakes (cmp ? smpc : lod ? smpl : smp).comparison_texture_srv, 2D) binds like a plain 2D texture input. Without this a comparison sampler is unreachable ("view kind 11 is not bound").slot.srv_dimension. Onmainit stays unset, and the dispatch path then takes the input for a described 1D, 2D-array or 3D view and refuses the Dispatch with "an input texture view is not 3D". So onmaina natively translated program cannot read a 2D texture at all; the third mutation below shows it.<key>.txtread next numbers its sampler lines from 0. This follows from the manifest reader's index check; no run exercises it.Points that differ from the plan in #3149 (see the comments there):
explicit_lodon every sampler it emits, so this route produces no plainsmpsampler. The conversion keeps the case; the fixture cannot cover it.translate_compute("nonconstant sampler") before the stand-in binds anything, so the sampler clause is dropped from the message, not split off.heap_samplerview and is refused by the view-kind message. This is read from the code and was not run.Verification
Environment: Windows 11 build 26300.9974, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), MSVC 14.44.35207, Windows SDK 10.0.26100 DXC, Debug build, D3D12 debug layer enabled. Commit
af6045df.11 tests selected: 10 passed, 1 capability skip, 0 failed.
startup_compute_dispatch_native_hardware: PASS (5.4 s). The four sampled channels match the CPU model in all 6,144 volume words, the memory sampler control leaves the volume untouched, and the other steps pass. No debug-layer error message.native_image_store_exact_width_hardware_{r,rg,rgb,array,volume,rgba,sparse}: PASS (7 tests, the same binding loop).startup_compute_dispatch_texture_hardware: PASS (shares the consumer's texture modes).startup_compute_descriptor_scc_hardware: PASS.startup_compute_dispatch_native_warp: capability skip (77), not a pass. The Microsoft Basic Render Driver 10.0.26100.9818 reports no 32-lane waves. Before it exits, the check confirms the sampled program is refused by that reason with the volume untouched, and the memory sampler control is refused with "nonconstant sampler".docs_links: 157 Markdown files and 682 links checked.bidi_controls: no bidirectional controls.prpreset, which does not include these tests.Mutations, each applied alone to
d3d12_compute_dispatch.inlataf6045df, with the stand-in rebuilt andstartup_compute_dispatch_native_hardwarererun:main(f5a6f6ba)not translated natively: view kind 11 is not bound for a natively translated programnot translated natively: a sampler, or more entry values, inputs or outputs than the dispatch path bindsDispatch(2, 1, 1) refused: an input texture view is not 3Dlod_limitsalways falsesampled: word 2049 got=bf000080 expected=bf000000 (32 words differ)comparisonalways falsesampled: word 2051 got=bf000080 expected=00000000 (16 words differ)sampled: word 2049 got=bf000080 expected=bf000000 (56 words differ)Evidence and follow-up
tests/startup_compute_dispatch_native_check.pyand the consumer modetexture-volume-native-sampled(the existing 3D float store plus a sampled input texture). Instruction words are hand-encoded and checked against thegfx2hlsldecoder inside the test. The guest root with two SRV records and one UAV record follows the table layout runtime: bind native compute table buffers and texture views #3049's fixture uses.image_sample_lz(wrap),image_sample_lwith LOD 1.25 under a [0, 0] clamp (mirror),image_sample_lwith LOD 0 under a [1, 1] clamp, andimage_sample_c_lz(LESS). U and the reference double with the global X, so a row covers both texels, three address modes and both comparison results. The CPU model decodes the address mode, the LOD limits and the comparison from the sampler words.docs/experiments/startup-compute-native-samplers.md): constant sampler words only; one texture format with point filters; no plain sampler; one adapter in a Debug build; no start-up run used the switch. A comparison sampler is bound without LOD limits, as on the published route. The compute path compares at level zero and the compiler requires MIN_LOD 0, so the limits cannot change the result.Checklist
AI-assisted.
🤖 Generated with Claude Code