Summary
cssl-cgen-gpu-spirv/src/binary_emit.rs has 7 near-identical .expect() calls:
let parsed = dr::load_words(&words).expect("rspirv must parse emitted binary");
These appear at lines ~394, 409, 442, 475, 499, 519, 539 — one per SPIR-V test case. They all do the same thing (round-trip the emitted binary through rspirv's parser) but give no context about which operation failed.
What to do
- Extract a helper function:
fn roundtrip(words: &[u32], ctx: &str) -> dr::Module {
dr::load_words(words).unwrap_or_else(|e| panic!("rspirv parse failed in {ctx}: {e}"))
}
- Replace all 7 call sites with
roundtrip(&words, "sphere_sdf_forward") etc.
Why this is a good first issue
- Self-contained change in a single file
- No type system or IR knowledge needed
- Teaches the SPIR-V codegen crate layout
- Improves debuggability when a future backend change breaks round-trip
Files
compiler-rs/crates/cssl-cgen-gpu-spirv/src/binary_emit.rs
Summary
cssl-cgen-gpu-spirv/src/binary_emit.rshas 7 near-identical.expect()calls:These appear at lines ~394, 409, 442, 475, 499, 519, 539 — one per SPIR-V test case. They all do the same thing (round-trip the emitted binary through rspirv's parser) but give no context about which operation failed.
What to do
roundtrip(&words, "sphere_sdf_forward")etc.Why this is a good first issue
Files
compiler-rs/crates/cssl-cgen-gpu-spirv/src/binary_emit.rs