Brandon Schneider
|
9c5fe97dc1
|
feat(infra): SPIR-V packet generator and WGSL scar filter shader
Add spirv_packet_generator.py: reads SPIR-V assembly, applies copy-if
optimization (OpPhi→OpSelect transform), and emits JSON packet descriptors
with the 5 OpPhi-derived fields (type_id, cond_id, true_val_id,
false_val_id, result_id) that fully specify the packet layout.
Add burgers_scar_filter.wgsl: 291-line WGSL compute shader for spectral
scar filtering in 2D Burgers RG solver. Uses three copy-if patterns:
1. scar_pressure > threshold → apply hyperviscosity damping
2. |kx| > k_cut || |ky| > k_cut → zero (dealiasing)
3. factor < 0.999 → multiply velocity components
Also fix spirv_copy_if_optimizer.py: OpSelect now uses phi_instr.args[0]
(type operand) as its type, instead of compute_instr.result_id. This
produces structurally correct SPIR-V where the result type matches the
OpSelect opcode layout.
Build: 3313 jobs, 0 errors (lake build)
Tools: glslang, spirv-as, spirv-dis (native); tint from nixpkgs for WGSL
|
2026-05-30 16:40:58 -05:00 |
|