Repository navigation
Conversation
`victory translate` prints how many of the translated programs' instructions work on 16-bit floats and how many of those are packed, so the game's share of f16 math can be read in one run (Marvisak#2384, Marvisak#2825). The count is of instructions in the code, not as run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kotekompotek
left a comment
There was a problem hiding this comment.
Harmless and useful: counting f16 instructions (with the packed subset split out) is exactly the measurement #2825's native-half path needs to be judged against. Only counted on translated programs so the share is honest. LGTM.
|
@Proudnoob4 you've run |
|
Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup.
AI-assisted (Hy4 flash). |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified head dc792c30 cleanly merged onto origin/main (63bcca43) on Windows 11 x64.
Code Review
- Scoped cleanly to
apps/victory/src/translate.rs(+39 lines) with no changes tovictory-shadertranslation output oremit/lower.rssize. - Cross-checked
f16_kind(name)((name.ends_with("_f16") || name.contains("_f16_")).then(|| name.starts_with("v_pk_"))) against all 89f16opcodes incrates/victory-shader/src/gfx10/opcodes.rs:Inst::name()returns the base mnemonic without_e32/_e64/_sdwa/_dppsuffixes, so all 89/89 match with 0 false negatives and 0 false positives (v_pk_*_f16under packed, and scalar/conversion/mix/dot/pack ops such asv_fma_mixlo_f16,v_dot2_f32_f16,v_cvt_pkrtz_f16_f32,v_pack_b32_f16under f16, matching the test assertions).
Local Verification
cargo test --locked -p victory: 15/15 unit tests passed (includingtranslate::tests::f16_instructions_are_counted_and_packed_ones_told_apart), pluscensus(2/2),census_unreadable(1/1),translate(1/1).cargo clippy --locked -p victory --all-targets -- -D warnings(default and--features diagnostics) &cargo xtask policy(191 files ok): clean.
Looks clean and ready to merge.
|
Automated triage for the maintainers. Merge candidate. This adds an CI: passing. Generated by Claude Code |
For #2384 and #2825.
Why
#2806 and #2825 measured what the translator's software f16 rounding costs against native 16-bit math, on NVIDIA, AMD and WARP. How much that saves in the game depends on one number nobody has posted: what share of the title's shader code is 16-bit float math. Anyone with the game's files can now read it in one run.
What
victory translateprints one more line after the program count:_f16operand or result (f16_kind): arithmetic, compares and conversions.v_pk_*ones are also counted as packed.IR instructionstotal, so the percentage is of that total.Tests
f16_instructions_are_counted_and_packed_ones_told_apart:f16_kindon packed, scalar, compare and conversion_f16names, and on names that are not f16 (v_fma_f32,v_pk_add_u16,s_mov_b32, empty).cargo test --locked -p victory --bin victory translate: 2 passed.cargo clippy --locked -p victory --all-targets -- -D warnings: clean.cargo fmt --check: clean.cargo xtask policy: 190 files ok.victory translateon an empty folder prints the new line with zeros.Not done
shaders.rpf, thef16line fromvictory translate <game dir>\shaders.rpfwould answer Shaders: f16 arithmetic in native half on hosts with 16-bit operations (37x on an RTX 5070 Ti; for #2384) #2825's open question.f16_kindis.🤖 Generated with Claude Code