Skip to content

[WIP] difftests: integrate spirti for emulating SPIR-V shaders on the CPU. - #599

Draft
eddyb wants to merge 8 commits into
mainfrom
eddyb/difftests-spirti
Draft

[WIP] difftests: integrate spirti for emulating SPIR-V shaders on the CPU.#599
eddyb wants to merge 8 commits into
mainfrom
eddyb/difftests-spirti

Conversation

@eddyb

Copy link
Copy Markdown
Member

This PR uses spirti from the branch corresponding to this (yet unlanded) PR:


I've been testing with this command:

SPIRTI_DEBUG=trace-all DIFFTEST_SPIRTI= cargo nextest run -P difftests -p difftests --release --no-default-features --features use-installed-tools --no-capture

The DIFFTEST_SPIRTI env var bypasses the wgpu runner of difftests, and feeds the SPIR-V blob through spirti instead (alongside with plumbing buffer inputs and outputs).

Just to get any tests passing, spirti was augmented with:

  • non-uniform pointers (e.g. indexing arrays by the invocation ID)
  • global-vs-local memory scoping (akin to semantic address spaces)
  • non-uniform control-flow (a la "execution masks")

As a result, this is the summary from the above command:

 Summary [ 71.626s] 21 tests run: 10 passed, 11 failed, 0 skipped
FAIL [ 21.707s] ( 1/21) difftests::difftests difftests::arch::atomic_ops
FAIL [ 1.706s] ( 2/21) difftests::difftests difftests::arch::memory_barriers
FAIL [ 2.757s] ( 4/21) difftests::difftests difftests::arch::vector_extract_insert
FAIL [ 1.741s] ( 5/21) difftests::difftests difftests::arch::workgroup_memory
FAIL [ 1.753s] ( 9/21) difftests::difftests difftests::lang::control_flow
FAIL [ 2.744s] (10/21) difftests::difftests difftests::lang::control_flow_complex
FAIL [ 2.797s] (13/21) difftests::difftests difftests::lang::core::ops::bitwise_ops
FAIL [ 3.773s] (14/21) difftests::difftests difftests::lang::core::ops::const_fold_int
FAIL [ 1.796s] (15/21) difftests::difftests difftests::lang::core::ops::math_ops
FAIL [ 1.772s] (17/21) difftests::difftests difftests::lang::core::ops::trig_ops
FAIL [ 1.782s] (19/21) difftests::difftests difftests::lang::core::ops::vector_swizzle

Some of the remaining failures seem potentially easy to fix, with workgroup-shared memory semantics being the one that's least obvious how to best approach.

@Firestar99
Firestar99force-pushed the difftest_runner_cleanup branch from 6c892fd to dbbdea8CompareJuly 13, 2026 11:44
Base automatically changed from difftest_runner_cleanup to mainJuly 13, 2026 12:34
Sign up for freeto 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.

2 participants

@eddyb@Firestar99