Skip to content

Add CommittedPrimitiveIndex test on a multi-triangle BLAS#1272

Merged
EmilioLaiso merged 1 commit into
llvm:mainfrom
Traverse-Research:inlinert-primitive-index
Jun 15, 2026
Merged

Add CommittedPrimitiveIndex test on a multi-triangle BLAS#1272
EmilioLaiso merged 1 commit into
llvm:mainfrom
Traverse-Research:inlinert-primitive-index

Conversation

@MarijnS95

@MarijnS95 MarijnS95 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacks on top of #1232 / #1245. Adds the first InlineRT test with a non-trivial BLAS layout — three triangles tiled along x at x = -4, 0, +4 — and a 3-lane dispatch that fires one ray per lane straight down at its own triangle. Each lane's CommittedPrimitiveIndex() must equal its lane index. Also exercises divergent rays per thread for free.

Seed test for the multi-primitive / multi-geometry BLAS bullets in the inline-RT coverage epic (#1258).

Independent of the other InlineRT test PRs (#1271, #1274) — only adds a new test file.

Test plan

Local on an NVIDIA RTX 3060:

  • Linux Vulkan (native offloader)
  • Linux D3D12 (Wine + vkd3d-proton + cross-compiled offloader.exe)
  • Windows Vulkan (native offloader.exe)
  • Windows D3D12 (native offloader.exe)

CI (RT-capable runners):

  • windows-nvidia D3D12 (RaytracingTier 1.2)
  • windows-intel VK (VK_KHR_ray_tracing_pipeline)
  • macOS Metal (supportsRaytracing)

@MarijnS95 MarijnS95 force-pushed the inlinert-primitive-index branch from dda00e6 to 9e5141e Compare June 3, 2026 09:25
MarijnS95 added a commit to Traverse-Research/offload-test-suite that referenced this pull request Jun 3, 2026
Four small tests stacked on top of llvm#1275, each isolating one
shader-observable PSO raytracing surface. They follow the same shape as
the inline-RT batch already in llvm#1271 / llvm#1272 / llvm#1274 / llvm#1276 — one .test
file per behavior, single-purpose shader, exact buffer comparison.

  - `dispatch-rays-index.test` — 4x1x1 dispatch, raygen writes
    `DispatchRaysIndex().x` into `Output[index]`. Confirms the
    dispatch grid plumbs through to the per-lane system value with no
    BLAS / TLAS / hit groups in play (RT-pipeline-only, no AS binding).
  - `dispatch-rays-dimensions.test` — 2x3x1 dispatch, raygen packs the
    constant `DispatchRaysDimensions()` into one uint per lane.
    Confirms every lane sees the host-side `{W, H, D}` even when only
    one dimension > 1.
  - `miss-shader-index.test` — two miss shaders writing distinct
    sentinels (0xAA / 0xBB). 2-lane dispatch picks `MissShaderIndex` 0
    and 1 respectively; rays start far enough from the geometry that
    every ray misses. Verifies the SBT miss region's per-record
    routing.
  - `ray-contribution-to-hit-group-index.test` — two hit groups with
    distinct closest-hit shaders (0xA1 / 0xB2). 2-lane dispatch picks
    `RayContributionToHitGroupIndex` 0 and 1, every ray hits the same
    triangle. Verifies the SBT hit-group region's per-record routing.

The first two have no AS / Miss / HitGroup in their pipeline at all —
just a raygen + a UAV — which exercises the minimum viable RT pipeline
shape (one raygen group, zero-sized miss / hit / callable SBT regions).
The latter two reuse the single-triangle BLAS/TLAS from
`raygen-roundtrip.test`.

All four tests are `# REQUIRES: raytracing-pipeline` with `# XFAIL: Clang`
— Clang (`clang-dxc`) doesn't yet lower `[shader("…")]` entry points to
either DXIL libraries or SPIR-V. With the Metal RT bring-up rebased on
top, all four pass natively on Apple Silicon and Metal is dropped from
the XFAIL list.

Locally verified end-to-end on the user's Linux box:
  - Vulkan via the native offloader against an NVIDIA RTX 3060:
    all four tests PASS.
  - D3D12 via Wine + vkd3d-proton + the cross-compiled offloader.exe
    on the same GPU: all four tests PASS.
And on macOS 15 / metal-irconverter 3.1.1:
  - Metal via the native offloader: all four tests PASS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MarijnS95 MarijnS95 force-pushed the inlinert-primitive-index branch from 9e5141e to 63d7717 Compare June 8, 2026 12:32
MarijnS95 added a commit to Traverse-Research/offload-test-suite that referenced this pull request Jun 8, 2026
Four small tests stacked on top of llvm#1275, each isolating one
shader-observable PSO raytracing surface. They follow the same shape as
the inline-RT batch already in llvm#1271 / llvm#1272 / llvm#1274 / llvm#1276 — one .test
file per behavior, single-purpose shader, exact buffer comparison.

  - `dispatch-rays-index.test` — 4x1x1 dispatch, raygen writes
    `DispatchRaysIndex().x` into `Output[index]`. Confirms the
    dispatch grid plumbs through to the per-lane system value with no
    BLAS / TLAS / hit groups in play (RT-pipeline-only, no AS binding).
  - `dispatch-rays-dimensions.test` — 2x3x1 dispatch, raygen packs the
    constant `DispatchRaysDimensions()` into one uint per lane.
    Confirms every lane sees the host-side `{W, H, D}` even when only
    one dimension > 1.
  - `miss-shader-index.test` — two miss shaders writing distinct
    sentinels (0xAA / 0xBB). 2-lane dispatch picks `MissShaderIndex` 0
    and 1 respectively; rays start far enough from the geometry that
    every ray misses. Verifies the SBT miss region's per-record
    routing.
  - `ray-contribution-to-hit-group-index.test` — two hit groups with
    distinct closest-hit shaders (0xA1 / 0xB2). 2-lane dispatch picks
    `RayContributionToHitGroupIndex` 0 and 1, every ray hits the same
    triangle. Verifies the SBT hit-group region's per-record routing.

The first two have no AS / Miss / HitGroup in their pipeline at all —
just a raygen + a UAV — which exercises the minimum viable RT pipeline
shape (one raygen group, zero-sized miss / hit / callable SBT regions).
The latter two reuse the single-triangle BLAS/TLAS from
`raygen-roundtrip.test`.

All four tests are `# REQUIRES: raytracing-pipeline` with `# XFAIL: Clang`
— Clang (`clang-dxc`) doesn't yet lower `[shader("…")]` entry points to
either DXIL libraries or SPIR-V. With the Metal RT bring-up rebased on
top, all four pass natively on Apple Silicon and Metal is dropped from
the XFAIL list.

Locally verified end-to-end on the user's Linux box:
  - Vulkan via the native offloader against an NVIDIA RTX 3060:
    all four tests PASS.
  - D3D12 via Wine + vkd3d-proton + the cross-compiled offloader.exe
    on the same GPU: all four tests PASS.
And on macOS 15 / metal-irconverter 3.1.1:
  - Metal via the native offloader: all four tests PASS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MarijnS95 MarijnS95 force-pushed the inlinert-primitive-index branch from 63d7717 to 5c58630 Compare June 11, 2026 14:12
Introduces a 3-triangle BLAS (tiled along x at x = -4, 0, +4) and a
3-lane dispatch that fires one ray per lane straight down at its own
triangle. Each lane's CommittedPrimitiveIndex() must equal its lane
index. Also exercises divergent rays per thread.

Part of the inline-RT test coverage epic
(llvm#1258).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MarijnS95 MarijnS95 marked this pull request as ready for review June 11, 2026 16:56
@MarijnS95 MarijnS95 force-pushed the inlinert-primitive-index branch from 5c58630 to dd553d1 Compare June 11, 2026 16:56
@EmilioLaiso EmilioLaiso merged commit 3053b5c into llvm:main Jun 15, 2026
27 checks passed
EmilioLaiso pushed a commit that referenced this pull request Jun 15, 2026
## Summary

Stacks on top of #1232 / #1245. Three TLAS instances at `x = -5, 0, +5`
with `InstanceMask` values `0x01` / `0x02` / `0x04` and `InstanceID`s
`0` / `1` / `2`. A 3-lane dispatch fires one ray per lane straight down
at its own instance column, but every ray uses `InstanceInclusionMask =
0x02` — so only the middle instance survives the mask test. Lane 1
reports `InstanceID = 1`; lanes 0 and 2 miss.

Covers the `InstanceInclusionMask` filtering bullet in the inline-RT
coverage epic (#1258).

Independent of the other InlineRT test PRs (#1271, #1272) — only adds a
new test file.

## Test plan

Local on an NVIDIA RTX 3060:
- [x] Linux Vulkan (native `offloader`)
- [x] Linux D3D12 (Wine + vkd3d-proton + cross-compiled `offloader.exe`)
- [ ] Windows Vulkan (native `offloader.exe`)
- [ ] Windows D3D12 (native `offloader.exe`)

CI (RT-capable runners):
- [ ] windows-nvidia D3D12 (`RaytracingTier 1.2`)
- [ ] windows-intel VK (`VK_KHR_ray_tracing_pipeline`)
- [x] macOS Metal (`supportsRaytracing`)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EmilioLaiso pushed a commit that referenced this pull request Jun 15, 2026
## Summary

Stacks on top of #1232 / #1245. Two rays at the existing single-triangle
BLAS — one from +z (sees the front face per the default winding
convention all three backends share) and one from -z (sees the back
face) — with the `RAY_FLAG_CULL_BACK_FACING_TRIANGLES` template flag
set. Lane 0 must hit and lane 1 must miss.

Independent of the other InlineRT test PRs (#1271, #1272, #1274) — only
adds a new test file.

## Test plan

Local on an NVIDIA RTX 3060:
- [x] Linux Vulkan (native `offloader`)
- [x] Linux D3D12 (Wine + vkd3d-proton + cross-compiled `offloader.exe`)
- [ ] Windows Vulkan (native `offloader.exe`)
- [ ] Windows D3D12 (native `offloader.exe`)

CI (RT-capable runners):
- [x] windows-nvidia D3D12 (`RaytracingTier 1.2`)
- [ ] windows-intel VK (`VK_KHR_ray_tracing_pipeline`)
- [x] macOS Metal (`supportsRaytracing`)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EmilioLaiso pushed a commit to Traverse-Research/offload-test-suite that referenced this pull request Jun 24, 2026
Four small tests stacked on top of llvm#1275, each isolating one
shader-observable PSO raytracing surface. They follow the same shape as
the inline-RT batch already in llvm#1271 / llvm#1272 / llvm#1274 / llvm#1276 — one .test
file per behavior, single-purpose shader, exact buffer comparison.

  - `dispatch-rays-index.test` — 4x1x1 dispatch, raygen writes
    `DispatchRaysIndex().x` into `Output[index]`. Confirms the
    dispatch grid plumbs through to the per-lane system value with no
    BLAS / TLAS / hit groups in play (RT-pipeline-only, no AS binding).
  - `dispatch-rays-dimensions.test` — 2x3x1 dispatch, raygen packs the
    constant `DispatchRaysDimensions()` into one uint per lane.
    Confirms every lane sees the host-side `{W, H, D}` even when only
    one dimension > 1.
  - `miss-shader-index.test` — two miss shaders writing distinct
    sentinels (0xAA / 0xBB). 2-lane dispatch picks `MissShaderIndex` 0
    and 1 respectively; rays start far enough from the geometry that
    every ray misses. Verifies the SBT miss region's per-record
    routing.
  - `ray-contribution-to-hit-group-index.test` — two hit groups with
    distinct closest-hit shaders (0xA1 / 0xB2). 2-lane dispatch picks
    `RayContributionToHitGroupIndex` 0 and 1, every ray hits the same
    triangle. Verifies the SBT hit-group region's per-record routing.

The first two have no AS / Miss / HitGroup in their pipeline at all —
just a raygen + a UAV — which exercises the minimum viable RT pipeline
shape (one raygen group, zero-sized miss / hit / callable SBT regions).
The latter two reuse the single-triangle BLAS/TLAS from
`raygen-roundtrip.test`.

All four tests are `# REQUIRES: raytracing-pipeline` with `# XFAIL: Clang`
— Clang (`clang-dxc`) doesn't yet lower `[shader("…")]` entry points to
either DXIL libraries or SPIR-V. With the Metal RT bring-up rebased on
top, all four pass natively on Apple Silicon and Metal is dropped from
the XFAIL list.

Locally verified end-to-end on the user's Linux box:
  - Vulkan via the native offloader against an NVIDIA RTX 3060:
    all four tests PASS.
  - D3D12 via Wine + vkd3d-proton + the cross-compiled offloader.exe
    on the same GPU: all four tests PASS.
And on macOS 15 / metal-irconverter 3.1.1:
  - Metal via the native offloader: all four tests PASS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EmilioLaiso pushed a commit to Traverse-Research/offload-test-suite that referenced this pull request Jun 25, 2026
Four small tests stacked on top of llvm#1275, each isolating one
shader-observable PSO raytracing surface. They follow the same shape as
the inline-RT batch already in llvm#1271 / llvm#1272 / llvm#1274 / llvm#1276 — one .test
file per behavior, single-purpose shader, exact buffer comparison.

  - `dispatch-rays-index.test` — 4x1x1 dispatch, raygen writes
    `DispatchRaysIndex().x` into `Output[index]`. Confirms the
    dispatch grid plumbs through to the per-lane system value with no
    BLAS / TLAS / hit groups in play (RT-pipeline-only, no AS binding).
  - `dispatch-rays-dimensions.test` — 2x3x1 dispatch, raygen packs the
    constant `DispatchRaysDimensions()` into one uint per lane.
    Confirms every lane sees the host-side `{W, H, D}` even when only
    one dimension > 1.
  - `miss-shader-index.test` — two miss shaders writing distinct
    sentinels (0xAA / 0xBB). 2-lane dispatch picks `MissShaderIndex` 0
    and 1 respectively; rays start far enough from the geometry that
    every ray misses. Verifies the SBT miss region's per-record
    routing.
  - `ray-contribution-to-hit-group-index.test` — two hit groups with
    distinct closest-hit shaders (0xA1 / 0xB2). 2-lane dispatch picks
    `RayContributionToHitGroupIndex` 0 and 1, every ray hits the same
    triangle. Verifies the SBT hit-group region's per-record routing.

The first two have no AS / Miss / HitGroup in their pipeline at all —
just a raygen + a UAV — which exercises the minimum viable RT pipeline
shape (one raygen group, zero-sized miss / hit / callable SBT regions).
The latter two reuse the single-triangle BLAS/TLAS from
`raygen-roundtrip.test`.

All four tests are `# REQUIRES: raytracing-pipeline` with `# XFAIL: Clang`
— Clang (`clang-dxc`) doesn't yet lower `[shader("…")]` entry points to
either DXIL libraries or SPIR-V. With the Metal RT bring-up rebased on
top, all four pass natively on Apple Silicon and Metal is dropped from
the XFAIL list.

Locally verified end-to-end on the user's Linux box:
  - Vulkan via the native offloader against an NVIDIA RTX 3060:
    all four tests PASS.
  - D3D12 via Wine + vkd3d-proton + the cross-compiled offloader.exe
    on the same GPU: all four tests PASS.
And on macOS 15 / metal-irconverter 3.1.1:
  - Metal via the native offloader: all four tests PASS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
EmilioLaiso pushed a commit that referenced this pull request Jun 26, 2026
Depends on #1281

## Summary

Four small PSO raytracing tests stacked on top of #1275, each isolating
one shader-observable surface from the 👍 list in #1268. Same shape as
the inline-RT batch already in flight in #1271 / #1272 / #1274 / #1276 —
one `.test` file per behavior, single-purpose shader, exact buffer
comparison.

- `dispatch-rays-index.test` — 4x1x1 dispatch, raygen writes
`DispatchRaysIndex().x` into `Output[index]`. Confirms the dispatch grid
plumbs through to the per-lane system value with no BLAS / TLAS / hit
groups in play (RT-pipeline-only, no AS binding).
- `dispatch-rays-dimensions.test` — 2x3x1 dispatch, raygen packs the
constant `DispatchRaysDimensions()` into one uint per lane. Confirms
every lane sees the host-side `{W, H, D}` even when only one dimension >
1.
- `miss-shader-index.test` — two miss shaders writing distinct sentinels
(0xAA / 0xBB). 2-lane dispatch picks `MissShaderIndex` 0 and 1
respectively; rays start far enough from the geometry that every ray
misses. Verifies the SBT miss region's per-record routing.
- `ray-contribution-to-hit-group-index.test` — two hit groups with
distinct closest-hit shaders (0xA1 / 0xB2). 2-lane dispatch picks
`RayContributionToHitGroupIndex` 0 and 1, every ray hits the same
triangle. Verifies the SBT hit-group region's per-record routing.

The first two have no AS / Miss / HitGroup in their pipeline at all —
just a raygen + a UAV — which doubles as a regression check for the
minimum viable RT pipeline shape (one raygen group, zero-sized miss /
hit / callable SBT regions). The latter two reuse the single-triangle
BLAS / TLAS from `raygen-roundtrip.test`.

All four tests are `# REQUIRES: raytracing-pipeline` with `# XFAIL:
Clang` — `clang-dxc` doesn't yet lower `[shader("…")]` entry points to
either DXIL libraries or SPIR-V. With the Metal RT bring-up in #1281
rebased underneath this branch, all four pass natively on Apple Silicon
and `Metal` is dropped from the XFAIL list.

## Test plan

Local on an NVIDIA RTX 3060:
- [x] Linux Vulkan (native `offloader`)
- [x] Linux D3D12 (Wine + vkd3d-proton + cross-compiled `offloader.exe`)
- [ ] Windows Vulkan (native `offloader.exe`)
- [ ] Windows D3D12 (native `offloader.exe`)

CI (RT-capable runners):
- [ ] windows-nvidia D3D12 (`RaytracingTier 1.2`)
- [ ] windows-intel VK (`VK_KHR_ray_tracing_pipeline`)
- [x] macOS Metal (`supportsRaytracing`)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants