Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

A Shader Loop That Never Ran: What GPU Readback Found in gogpu/naga, a Go WGSL Compiler

说明与用途

naga v0.20.2 生成的 DXIL 中 WGSL 循环未执行,原因是缺失初始化。Microsoft 验证器报告 VALID,但 GPU 上循环未运行。v0.20.3 修复后循环正常执行,既通过静态验证也通过 GPU 读回测试。

问题

naga v0.20.2 emitted DXIL that never executed a WGSL loop, causing incorrect shader results on real GPUs.

结果

After fixing the DXIL backend, naga produces correct DXIL that executes loops as specified, passing both static validation and GPU runtime tests.

工作流

  • 1. Compile WGSL shader with naga v0.20.2 to DXIL.
  • 2. Run IDxcValidator – it reports VALID (S_OK).
  • 3. Execute shader on Intel/NVIDIA GPUs – loop body never runs.
  • 4. Identify bug via GPU readback experiment.
  • 5. Update DXIL backend in naga v0.20.3 to store loop initializer and correct loop logic.
  • 6. Re‑validate with IDxcValidator and run GPU tests to confirm correct execution.

证据

Microsoft's validator looked at the module and said it was valid. On an Intel and an NVIDIA GPU the loop body didn't execute once.

来源

naga v0.20.3 fixed three bugs of this kind in the DXIL backend: ... never stored the initializer; the loop didn't run

来源

What it doesn't check is whether the module computes what the source says. No static validator does, not DXC's and not spirv-val.

来源

  • 记录日期: 2026-11-03T18:28:46.134Z