Shader tests: no opcode of the ISA may crash the translator (port of Marvisak#2378) #673
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/673"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T03:20:24Z.
What
A census over the whole ISA. Every opcode of every decode table is encoded into a minimal pixel program and driven through decode → ir → structure → resource → io → emit. The tables are SOP2, SOPK, SOP1, SOPC, SOPP, SMEM, VOP1, VOP2, VOPC, VOP3, VOP3P, VINTRP, DS, MUBUF, MTBUF, MIMG, FLAT, GLOBAL and SCRATCH.
Ok, or a refusal that names what it lacks.catch_unwindturns any panic into a test failure. A title can reach any of these encodings, so none may take the translator down.pub(crate)now, so the census walks the decoder's own tables and follows new opcodes as they are added.On this tree the census gives 540 translated, 692 refused by name or reason, 0 panics, in 0.2 s. With
--nocaptureit lists each opcode's outcome, so the coverage of each family can be read.This is a port of borosf's test (Marvisak/VIctory#2378). The only conflict was the module list in
emit/mod.rs.Tests
cargo test -p victory-shader --locked --lib census -- --nocapture: passes, with the counts above.cargo clippy -p victory-shader --all-targets -- -D warnings, with and without--all-features: nothing in the new or changed lines. The one finding ismain's own inemit/mod.rs, fixed by #665.No game files, dumps or extracted data are included.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T05:36:49Z.
Review: APPROVED
LGTM — verified on Windows:
cargo test -p victory-shader --lib census_tests::passed (every_opcode_translate_or_refuse_never_panic)cargo clippy -p victory-shader --lib -- -D warningspassed with 0 warningscargo xtask policypassed (295 files ok)Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).