Repository navigation
Conversation
8761331 to
0061dc5
Compare
0061dc5 to
9c33b8c
Compare
|
Review (head 9c33b8c, diff read, not a merge-check):
Fine: by reading, the AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
9c33b8c to
bd104a3
Compare
|
@Foniass Thanks for the review! Rebased onto
Verified AI use: Antigravity (Gemini 4 Neon) applied the fixes and ran the build/test/smoke verification; Claude Code (Claude Opus 5.5) reviewed the diff and drafted the verification checks. |
|
Note on the |
Add direct-DXIL inline ray tracing support on Shader without changing any runtime path yet: - RaytracingAccelerationStructure SRVs (static t# binding and ResourceDescriptorHeap indexing requiring SM 6.6+, kind 16, U32 element type, PSV0 SrvRaw). - allocateRayQuery (requiring SM 6.5+), rayQuery_TraceRayInline, Proceed, Abort, CommitNonOpaqueTriangleHit, and StateScalar / StateVector queries (committed and candidate status, type, t, barycentrics, instance index / ID, geometry, primitive, front face). - Opcodes, overloads, and attributes match DXC 1.9 (state queries are readonly so CSE never merges them across Proceed); Feature::RaytracingTier1_1 sets metadata bit 25 and container bit 0x100000. - Helpers Shader::trace_any_hit (opaque first-hit shadow query with SKIP_PROCEDURAL_PRIMITIVES so procedural AABBs cannot stall the single-Proceed search) and Shader::trace_translucent (FORCE_NON_OPAQUE Proceed loop committing back faces and tracking the nearest front face). - DXIL 1.9 validator, SM 6.5/6.6 guard tests, and WARP DXR 1.1 execution tests comparing closest hit (t0 and descriptor heap, 48 single-triangle BLAS instances so the comparison does not depend on WARP's multi-triangle BLAS builder), non-zero primitive index on a 2-triangle BLAS, first hit, procedural-AABB skip in trace_any_hit, translucent back-face commit, FRONT_COUNTERCLOCKWISE, negative-determinant mirrored transform (object-space winding per DXR spec), front1/back2, and fronts-only against a CPU walk / f64 Moller-Trumbore reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Antigravity (Gemini 4 Neon)
|
Updated in
|
bd104a3 to
5bfb227
Compare
|
merge-check In short: Follow-up on 5bfb227; my last review was on 9c33b8c. The PR adds DXIL emitters for inline ray queries ( Medium
Nit
Checked and fine
How this was tested
Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point. |
|
merge-check Windows / AMD RDNA4 (native D3D12) — DXIL inline ray-query validation on Clean merge onto Setup
Tested
Counts are partial because two test processes aborted on each build.
Shared failures and process aborts
Diff review The selected checks covered emitted ray-query kernels and the shader-model gates. The execution fixture explicitly selects WARP, which lacked DXR 1.1 on this host. Not tested Remaining workspace tests after the aborts, ray-query execution against the BVH reference on WARP or the AMD hardware, and retail smoke (tier 1). AI use Codex (GPT-6) merged and built the PR, ran the tests, compared the results with |
bmjask
left a comment
There was a problem hiding this comment.
Review of 5bfb2274: 2 finding(s) (2 medium), most severe first.
- Medium
crates/xcl/src/gpu/dxil/shader.rs:510: see below. - Medium
crates/xcl/src/gpu/dxil/ray_query.rs:62:ray_queryonly requires SM 6.5, but both ways to get an acceleration structure need SM 6.6:accel_struct(no guard) andheap_accel_struct(guarded at 6.6). (inline)
On lines outside the diff:
- Medium
crates/xcl/src/gpu/dxil/shader.rs:510:infer_type_featuresnever clearsFeature::RaytracingTier1_1when the optimizer removes every RayQuery op, though it does for heap indexing, int64 atomics and the other flags. If a translated shader callstrace_any_hitin a branch thatoptimize()folds away as unreachable,ray_query()has already set the feature, so the container declares Raytracing tier 1.1 with no RayQuery op left, and the validator rejects the shader with 'Flags must match usage', the caseinfer_type_featuresexists to prevent. Recomputing the flag from the remaining ops would fix it.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| impl Shader { | ||
| /// `RaytracingAccelerationStructure` at `t<lower>, space<space>`: its handle, created in the | ||
| /// current block (call before emitting other code in the entry block). | ||
| pub fn accel_struct(&mut self, lower: u32, space: u32) -> Value { |
There was a problem hiding this comment.
Medium: ray_query only requires SM 6.5, but both ways to get an acceleration structure need SM 6.6: accel_struct (no guard) and heap_accel_struct (guarded at 6.6). Shader::new(_, (6, 5)) plus accel_struct(0, 0) and trace_any_hit passes every assertion but emits createHandleFromBinding/annotateHandle (ops 217/216), which only exist in SM 6.6, so the output is invalid DXIL. The 6.5 guard and ray_query_rejects_sm_below_6_5 claim support the builder can't produce. Adding the 6.6 assert to accel_struct (or raising ray_query's guard) would make it consistent.
|
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any. |
Add direct-DXIL DXR 1.1
RayQueryemission andRaytracingAccelerationStructureSRV support togpu::dxil::Shader. Nothing calls the new helpers yet, so default runtime behavior is unchanged; Live caller: #3705 (XCL_HW_RT_TRAVERSE=1swaps GPURT traversal loops forheap_accel_struct+trace_any_hit/trace_translucent). Part of #1751.Related: #2189 lowers
RayQuerythrough the HLSL path (gpu/recomp/rayquery.rs); this PR is the direct-DXIL emitter (gpu/dxil), with no shared files.(Why this is 951 lines and not split further: ~205 lines are the direct-DXIL
RayQueryemitter andShaderplumbing, and ~746 lines are the DXIL 1.9 validator, shader-model guard, and WARP execution tests for this same emitter, kept together becauseCONTRIBUTING.mdrequires new code to ship with its tests.)What is in it
crates/xcl/src/gpu/dxil/ray_query.rs:RaytracingAccelerationStructureSRV bindings (statict#binding andResourceDescriptorHeapindexing requiring SM 6.6+, resource kind 16, U32 element type, PSV0SrvRaw).dx.op.allocateRayQuery(requiring SM 6.5+),rayQuery_TraceRayInline,rayQuery_Proceed,rayQuery_Abort,rayQuery_CommitNonOpaqueTriangleHit, andrayQuery_StateScalar/rayQuery_StateVector(committed and candidate status, type,t, barycentrics, instance index / ID, geometry, primitive, front face). State queries carryReadOnlyso optimization/CSE never merges or hoists them acrossProceed.Shader::trace_any_hit(opaque first-hit shadow query withSKIP_PROCEDURAL_PRIMITIVESso procedural AABB candidates cannot stall the single-Proceedsearch; the only planned producer (the opt-inXCL_HW_RTshadow builder) builds triangle geometry only) andShader::trace_translucent(FORCE_NON_OPAQUEProceedloop that commits back faces and tracks the nearest front face).t0and descriptor heap, using 48 single-triangle BLAS instances under one TLAS so the comparison tests DXIL emission without depending on WARP's multi-triangle BLAS builder, which dropped one triangle in one Windows CI run (not reproduced locally)), non-zero primitive index readout on a 2-triangle BLAS, first hit, procedural-AABB skip intrace_any_hit, translucent back-face commit,FRONT_COUNTERCLOCKWISE, negative-determinant mirrored instance transform (object-space winding per DXR spec),front1/back2, and fronts-only against a CPU walk andf64Möller–Trumbore reference.crates/xcl/src/gpu/dxil/shader.rs&crates/xcl/src/gpu/dxil/mod.rs:ray_query, addFeature::RaytracingTier1_1(metadata bit 25, container bit0x100000), addkind::RT_ACCELERATION_STRUCTURE(16), and register DXR 1.1 opcodes (178..=183NoUnwind,184..=212 | 214 | 215ReadOnly) indxc_fn_attrs.Tested
rustc 1.99.0 (b940084d7 2026-09-28), DXC1.9.2609.5 (01b62ad47).cargo build --release -p xcl(commit5bfb227466149a342e2b1a4e10cfdc4f8aef495a): succeeded, 39 warnings (0 new vsmain).cargo test -p xcl --lib -- gpu::dxil::ray_query --nocapture: 4 passed, 0 failed, 0 ignored (ray_query_kernels_validate,ray_query_rejects_sm_below_6_5,heap_accel_struct_rejects_sm_below_6_6,warp_ray_query_matches_console_bvh_walk), plus 100 pinned-affinity runs (50 at0xF, 50 at0x3,0/100failures)..\scripts\test.ps1(debug build + benches + workspace tests--test-threads=4, commit5bfb227466149a342e2b1a4e10cfdc4f8aef495a): 2978 passed, 0 failed, 52 ignored across 43 test binaries.no wave64(RTX 5070 Ti is wave32-only), 2no heap windows(XCL_HEAP_WINDOWSopt-in off by default).Regression run
Not tested
RayQuery(tested on WARP DXR 1.1 and validated with DXC 1.9 here; live shader traversal callers are in the stacked follow-up PRs).AI use
Claude Opus 5.5): wrote the direct-DXILRayQueryemitter and WARP reference tests, and audited the diff, optimizer safety (ReadOnlystate queries acrossProceed), and DXR object-space winding semantics.Gemini 4 Neon): extracted the standalone PR onmain, extended the WARP test suite for deterministic front/back-face, mirrored-transform, procedural-AABB, and single-triangle-instance BLAS semantics, applied review fixes, ran the full build/test/smoke suite, and drafted the PR description.