D3D12-SHADER-FAST-HASH: hash the translator's tables with a multiply hasher, not SipHash (-10 to -15 % of full-archive translate time) #2750

Merged
bobcatchris merged 5 commits from upstream-pr/2750 into main 2026-12-01 11:13:30 +00:00
bobcatchris commented 2026-11-30 15:27:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-30T15:27:35Z.


Claim: D3D12-SHADER-FAST-HASH (comment).

AI-assisted: Claude Sonnet 5.5 (Cursor agent). No game files are in this pull request: the numbers are counts and times from running the translator on the author's own copy of the archive, and the tool that hashed the output was a local patch that is not part of it.

Depends on: #2745 (it adds two tables to Lower that this pull request gives the same hasher; the branch has #2745 merged in, so until that lands the diff shows both. This pull request alone is the six files bitcode.rs, bitcode/opt.rs, fxhash.rs, io.rs, lib.rs and the tables of lower.rs).

What

std::collections::HashMap hashes with SipHash. The keys of the translator's tables are numbers it made itself (values, blocks, types, sites) while reading the user's own file, so nothing gains from SipHash's resistance to chosen keys, and structure.rs already says "SipHash dominated run time" about its BDD tables and has its own hasher for them. The other tables did not.

Sampling profile (the built-in sampler, LEONIDA_PROFILE, diagnostics) of a whole-archive leonida translate, 24,055 samples at 5 ms over 16 threads, mimalloc build: SipHash (RandomState) was under a frame of the translator in 21 % of the samples: 13.7 % in Module::merge (the value-numbering tables known, read and Facts of emit/bitcode/opt.rs), 1.6 % in the interning tables of emit/bitcode.rs, 1.2 % in io::raise, 1.7 % in Lower::new and Lower::computed_with, and the rest in the tables of Lower. After this change SipHash is under 1 % of the samples (230 of 23,545).

  • New leonida-shader/src/fxhash.rs: FxHasher (a multiplication per word, then a rotation of the product so that the well mixed high bits are where a table takes its bucket from), FxHashMap and FxHashSet.
  • Used for the tables of Module (types, constants, functions), of Module::merge (known, read, joins, Facts), of io::raise and the tables Lower and its paired LaneState keep by value, block, site and descriptor (and the two index tables #2745 adds).
  • Only tables that are looked up, or walked for a result that is the same in any order (read_phis, a closure). structure.rs and the tables that are iterated for their order are left as they were. A hasher changes only the order a table is walked in, so the output is the thing to check, and it is below.

I said in the claim I would look at ir.rs and spill.rs too; I did not change them. After this change SipHash is under 1 % of the samples, so what is left of it is not worth a larger diff.

Result

Same machine (Ryzen 7 7800X3D, 16 threads), whole archive leonida translate <shaders.rpf> (LEONIDA_HOST_RDNA=1, 26,084 programs, 40.6 M IR instructions), --release, every build with the same local patch that appends blake3(dxil) of each emitted program to a file, alternating builds. CPU is user + kernel.

System heap (the build docs/README-fxceless.md shows):

build wall (3 runs) CPU (3 runs)
main 64.2 / 66.8 / 64.8 s 886 / 901 / 892 s
main + #2745 54.0 / 53.9 / 54.0 s 730 / 732 / 738 s
this pull request (with #2745) 48.4 / 49.3 / 48.3 s and 48.6 / 47.7 / 48.9 s 640 / 647 / 643 s and 640 / 640 / 645 s

--features diagnostics,mimalloc (the game's build):

build wall (3 runs) CPU (3 runs)
main 45.1 / 44.6 / 44.7 s 633 / 630 / 634 s
main + #2745 43.3 / 43.1 / 42.6 s 604 / 602 / 601 s
this pull request (with #2745) 36.8 / 36.8 / 36.4 s and 36.8 / 36.4 / 36.4 s 512 / 509 / 506 s and 503 / 505 / 505 s

Against main + #2745, which is what this pull request adds: about -10 % wall and -12 % CPU on the system heap, -15 % wall and -15 % CPU under mimalloc. Against main (both pull requests together): -26 % wall and -28 % CPU on the system heap, -18 % wall and -20 % CPU under mimalloc. (Each pull request's own effect when measured on main alone, the same way, before #2745 was merged in: 63.8 / 64.1 / 64.2 s -> 58.6 / 58.4 / 59.0 s and 885 / 889 / 889 -> 797 / 794 / 802 CPU-seconds on the system heap, 45.4 / 45.1 / 45.3 -> 40.6 / 40.2 / 41.6 s and 636 / 633 / 633 -> 562 / 558 / 562 under mimalloc.)

Output unchanged: the DXIL of all 25,689 emitted programs (15,799 distinct; the rest are duplicate containers) hashes the same in every run of every build in the tables, 24 runs after the last edit of the translator's code (12 of this pull request's builds, 12 of main and main + #2745) and the 12 runs I made of the standalone version of this change (old and new builds) before #2745 was merged in, compared as multisets of (hash, length) because the label of a duplicate container is whichever thread gets there first and differs between runs of the same build.

Tests

  • New fxhash::tests (3): equal keys hash equal, and near keys, a string and the same with zeros after it, and slices of different length differ; the low bits (a bucket) and the top seven (a tag) of the hashes of 131,072 small numbers, multiples of 4,096 and 65,536, pairs and triples spread within 3 times the mean (controlled: without the rotation of the product the multiples of 4,096 all land in one bucket and it fails); a map with the hasher agrees with a BTreeMap over 20,000 random inserts, removals and lookups.
  • cargo test -p leonida-shader --release --no-fail-fast: 389 passed, 1 failed, 4 ignored (394), doc tests 0. The one failure, emit::valu_tests::rdna_forms_give_what_the_spelled_out_ones_give (mad_legacy: written alike), fails the same on main without this change; it is what #2624 fixes.
  • cargo clippy -p leonida-shader --release --all-targets: 3 warnings in the library and 7 in its tests, none in a line this change touches (opt.rs:1225 and :1685, lower.rs:1698 and :2517, twin_bias_tests.rs, water_tests.rs: all older than this change by git blame).
  • python -I scripts/check_no_game_data.py on the seven files: clean.
  • No GPU is involved (leonida translate without --validate or --pipelines), so no GPU or driver to name.

Not covered: the effect on a title's frame time (it is the translation, not the frame). What is left of the translator's time is the BDD tables of structure.rs (#2726 is open there), spill::build, ir::build and Module::merge's own work.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5568267676 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2750). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-30T15:27:35Z. --- Claim: D3D12-SHADER-FAST-HASH ([comment](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7281430038)). AI-assisted: Claude Sonnet 5.5 (Cursor agent). No game files are in this pull request: the numbers are counts and times from running the translator on the author's own copy of the archive, and the tool that hashed the output was a local patch that is not part of it. Depends on: #2745 (it adds two tables to `Lower` that this pull request gives the same hasher; the branch has #2745 merged in, so until that lands the diff shows both. This pull request alone is the six files `bitcode.rs`, `bitcode/opt.rs`, `fxhash.rs`, `io.rs`, `lib.rs` and the tables of `lower.rs`). ## What `std::collections::HashMap` hashes with SipHash. The keys of the translator's tables are numbers it made itself (values, blocks, types, sites) while reading the user's own file, so nothing gains from SipHash's resistance to chosen keys, and `structure.rs` already says "SipHash dominated run time" about its BDD tables and has its own hasher for them. The other tables did not. Sampling profile (the built-in sampler, `LEONIDA_PROFILE`, `diagnostics`) of a whole-archive `leonida translate`, 24,055 samples at 5 ms over 16 threads, mimalloc build: SipHash (`RandomState`) was under a frame of the translator in 21 % of the samples: 13.7 % in `Module::merge` (the value-numbering tables `known`, `read` and `Facts` of `emit/bitcode/opt.rs`), 1.6 % in the interning tables of `emit/bitcode.rs`, 1.2 % in `io::raise`, 1.7 % in `Lower::new` and `Lower::computed_with`, and the rest in the tables of `Lower`. After this change SipHash is under 1 % of the samples (230 of 23,545). - New `leonida-shader/src/fxhash.rs`: `FxHasher` (a multiplication per word, then a rotation of the product so that the well mixed high bits are where a table takes its bucket from), `FxHashMap` and `FxHashSet`. - Used for the tables of `Module` (types, constants, functions), of `Module::merge` (`known`, `read`, `joins`, `Facts`), of `io::raise` and the tables `Lower` and its paired `LaneState` keep by value, block, site and descriptor (and the two index tables #2745 adds). - Only tables that are looked up, or walked for a result that is the same in any order (`read_phis`, a closure). `structure.rs` and the tables that are iterated for their order are left as they were. A hasher changes only the order a table is walked in, so the output is the thing to check, and it is below. I said in the claim I would look at `ir.rs` and `spill.rs` too; I did not change them. After this change SipHash is under 1 % of the samples, so what is left of it is not worth a larger diff. ## Result Same machine (Ryzen 7 7800X3D, 16 threads), whole archive `leonida translate <shaders.rpf>` (`LEONIDA_HOST_RDNA=1`, 26,084 programs, 40.6 M IR instructions), `--release`, every build with the same local patch that appends `blake3(dxil)` of each emitted program to a file, alternating builds. CPU is user + kernel. System heap (the build `docs/README-fxceless.md` shows): | build | wall (3 runs) | CPU (3 runs) | |---|---|---| | `main` | 64.2 / 66.8 / 64.8 s | 886 / 901 / 892 s | | `main` + #2745 | 54.0 / 53.9 / 54.0 s | 730 / 732 / 738 s | | this pull request (with #2745) | 48.4 / 49.3 / 48.3 s and 48.6 / 47.7 / 48.9 s | 640 / 647 / 643 s and 640 / 640 / 645 s | `--features diagnostics,mimalloc` (the game's build): | build | wall (3 runs) | CPU (3 runs) | |---|---|---| | `main` | 45.1 / 44.6 / 44.7 s | 633 / 630 / 634 s | | `main` + #2745 | 43.3 / 43.1 / 42.6 s | 604 / 602 / 601 s | | this pull request (with #2745) | 36.8 / 36.8 / 36.4 s and 36.8 / 36.4 / 36.4 s | 512 / 509 / 506 s and 503 / 505 / 505 s | Against `main` + #2745, which is what this pull request adds: about -10 % wall and -12 % CPU on the system heap, -15 % wall and -15 % CPU under mimalloc. Against `main` (both pull requests together): -26 % wall and -28 % CPU on the system heap, -18 % wall and -20 % CPU under mimalloc. (Each pull request's own effect when measured on `main` alone, the same way, before #2745 was merged in: 63.8 / 64.1 / 64.2 s -> 58.6 / 58.4 / 59.0 s and 885 / 889 / 889 -> 797 / 794 / 802 CPU-seconds on the system heap, 45.4 / 45.1 / 45.3 -> 40.6 / 40.2 / 41.6 s and 636 / 633 / 633 -> 562 / 558 / 562 under mimalloc.) **Output unchanged:** the DXIL of all 25,689 emitted programs (15,799 distinct; the rest are duplicate containers) hashes the same in every run of every build in the tables, 24 runs after the last edit of the translator's code (12 of this pull request's builds, 12 of `main` and `main` + #2745) and the 12 runs I made of the standalone version of this change (old and new builds) before #2745 was merged in, compared as multisets of (hash, length) because the label of a duplicate container is whichever thread gets there first and differs between runs of the same build. ## Tests - New `fxhash::tests` (3): equal keys hash equal, and near keys, a string and the same with zeros after it, and slices of different length differ; the low bits (a bucket) and the top seven (a tag) of the hashes of 131,072 small numbers, multiples of 4,096 and 65,536, pairs and triples spread within 3 times the mean (controlled: without the rotation of the product the multiples of 4,096 all land in one bucket and it fails); a map with the hasher agrees with a `BTreeMap` over 20,000 random inserts, removals and lookups. - `cargo test -p leonida-shader --release --no-fail-fast`: 389 passed, 1 failed, 4 ignored (394), doc tests 0. The one failure, `emit::valu_tests::rdna_forms_give_what_the_spelled_out_ones_give` (`mad_legacy: written alike`), fails the same on `main` without this change; it is what #2624 fixes. - `cargo clippy -p leonida-shader --release --all-targets`: 3 warnings in the library and 7 in its tests, none in a line this change touches (`opt.rs:1225` and `:1685`, `lower.rs:1698` and `:2517`, `twin_bias_tests.rs`, `water_tests.rs`: all older than this change by `git blame`). - `python -I scripts/check_no_game_data.py` on the seven files: clean. - No GPU is involved (`leonida translate` without `--validate` or `--pipelines`), so no GPU or driver to name. Not covered: the effect on a title's frame time (it is the translation, not the frame). What is left of the translator's time is the BDD tables of `structure.rs` (#2726 is open there), `spill::build`, `ir::build` and `Module::merge`'s own work.
merzleckeier commented 2026-11-30 15:34:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-30T15:34:11Z.


Independent synthetic DXIL comparison for PR #2750

MEASURED (3 fresh processes per arm). On CachyOS x86-64 with Rust 1.98.1, I compared main be769080 plus #2745 88d0dbf9 (tree e815bee7) against the same main plus #2750 55996ef0 (tree 2efcd9b3). The diff between the two trees is the six hasher files. I built with cargo +1.98.1 test --locked --offline -p leonida-shader --lib --no-run, then ran each test binary three times with --test-threads=1. The same test-only instrumentation in both arms captured bytes at Module::write and the end of shader lowering, keyed by test and emission ordinal.

  • 4,927 raw bitcode serializations matched byte for byte in every run. These include the optimizer's 400 seeded programs across 12 pass combinations plus 127 other serializations.
  • 108 DXIL containers (79 distinct byte strings) captured from the end of lowering matched byte for byte in every run. The descriptor fixture harness contributed 8 of those. Its 8 host metadata files and one expected rejection also matched.
  • The library suite passed 231 tests with #2745 and 234 with #2750 (2 ignored per run). Each count includes the same local descriptor fixture harness.

A second agent independently compared the six directories and checked the counts against the raw output. This was CPU-only translation of synthetic fixtures. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7283210747 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2750#issuecomment-7283210747). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-11-30T15:34:11Z. --- # Independent synthetic DXIL comparison for PR #2750 **MEASURED (3 fresh processes per arm).** On CachyOS x86-64 with Rust 1.98.1, I compared `main` `be769080` plus #2745 `88d0dbf9` (tree `e815bee7`) against the same main plus #2750 `55996ef0` (tree `2efcd9b3`). The diff between the two trees is the six hasher files. I built with `cargo +1.98.1 test --locked --offline -p leonida-shader --lib --no-run`, then ran each test binary three times with `--test-threads=1`. The same test-only instrumentation in both arms captured bytes at `Module::write` and the end of shader lowering, keyed by test and emission ordinal. - **4,927 raw bitcode serializations** matched byte for byte in every run. These include the optimizer's 400 seeded programs across 12 pass combinations plus 127 other serializations. - **108 DXIL containers** (79 distinct byte strings) captured from the end of lowering matched byte for byte in every run. The descriptor fixture harness contributed 8 of those. Its 8 host metadata files and one expected rejection also matched. - The library suite passed **231 tests with #2745 and 234 with #2750** (2 ignored per run). Each count includes the same local descriptor fixture harness. A second agent independently compared the six directories and checked the counts against the raw output. This was CPU-only translation of synthetic fixtures. AI-assisted with OpenAI Codex.
Kal0s-design commented 2026-11-30 20:35:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-11-30T20:35:59Z.


Native Windows check of 2e78c2ab4 on current main d8ca18240, where #2745 has landed, so the merge (aa8ee507f) differs from main by this PR's 6 files only. Windows 11, MSVC x64, Rust 1.98.1, the full cargo test -p leonida-shader --lib on a hardware GPU (not WARP), so the DXIL validation and GPU dispatch/readback tests run with the new hasher's table order.

  • Merge: 403 passed, 0 failed, 5 ignored. main lists 405 tests (400 run + 5 ignored), the merge 408, so the 3 additions are the only difference and no existing test changes result.
  • This complements merzleckeier's synthetic DXIL comparison on Linux with a run where the translated programs are validated and executed on Windows.

Not covered: translation time and output identity on the title's real shaders.

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7291178395 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2750#issuecomment-7291178395). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-30T20:35:59Z. --- **Native Windows check** of `2e78c2ab4` on current `main` `d8ca18240`, where #2745 has landed, so the merge (`aa8ee507f`) differs from `main` by this PR's 6 files only. Windows 11, MSVC x64, Rust 1.98.1, the full `cargo test -p leonida-shader --lib` on a hardware GPU (not WARP), so the DXIL validation and GPU dispatch/readback tests run with the new hasher's table order. - Merge: 403 passed, 0 failed, 5 ignored. `main` lists 405 tests (400 run + 5 ignored), the merge 408, so the 3 additions are the only difference and no existing test changes result. - This complements merzleckeier's synthetic DXIL comparison on Linux with a run where the translated programs are validated and executed on Windows. Not covered: translation time and output identity on the title's real shaders. AI-assisted: yes
aslan2142 commented 2026-12-01 11:13:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:13:27Z.

Review: APPROVED


Clean, zero-dependency FxHasher implementation in d3d12/crates/leonida-shader/src/fxhash.rs with tail-length mixing (rest.len() << 56), thorough distribution/collision/BTreeMap parity tests, and strictly scoped map/set swaps across bitcode.rs, bitcode/opt.rs, lower.rs, and io.rs (confirmed against main with no conflicts or unused imports after #2687). Independently verified on Windows/GPU (403/0 tests and byte-identical DXIL output) and all CI checks are green. Merging.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130101383 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2750#pullrequestreview-6130101383). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:13:27Z. **Review:** APPROVED --- Clean, zero-dependency `FxHasher` implementation in `d3d12/crates/leonida-shader/src/fxhash.rs` with tail-length mixing (`rest.len() << 56`), thorough distribution/collision/BTreeMap parity tests, and strictly scoped map/set swaps across `bitcode.rs`, `bitcode/opt.rs`, `lower.rs`, and `io.rs` (confirmed against `main` with no conflicts or unused imports after `#2687`). Independently verified on Windows/GPU (403/0 tests and byte-identical DXIL output) and all CI checks are green. Merging. *(AI-assisted review.)*
enlight3d commented 2026-12-01 11:18:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-01T11:18:02Z.


Posted after the merge: the head tested below is the one that was merged.

RUN (independent run on Windows, #2750 head b75e391a8, merged locally into main e56aff1ce with git merge --no-ff, no conflicts. #2745 is already in main, so the merge adds only the six files of this pull request. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)

Commands, in d3d12/, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with --locked, at low priority, RUST_TEST_THREADS=8:

  • cargo test -p leonida-shader --no-fail-fast: main 405 passed / 0 failed / 5 ignored; merge 408 / 0 / 5 (the 3 new fxhash tests). The rdna_forms_give_what_the_spelled_out_ones_give failure named in the body is fixed on main (#2624): it passes on both sides.
  • cargo test -p leonida-shader --no-fail-fast --features diagnostics: main 405 / 0 / 5; merge 408 / 0 / 5.
  • Red: on main the new tests cannot compile (there is no fxhash module), so the red is by mutation of the new hasher, with its tests kept:
    • Rotation removed from finish (self.0 instead of self.0.rotate_left(26)): small_number_keys_spread_over_buckets_and_tags fails with "i * 4096: a bucket of 131072 against a mean of 32". This is the control the body describes.
    • Tail length dropped from write (self.add(u64::from_le_bytes(word))): the_same_key_hashes_the_same_and_near_keys_differ fails on "a" and "a\0" (the same hash for both).
    • Green: the file restored (git status clean), cargo test -p leonida-shader --lib fxhash: 3 passed.
  • cargo clippy -p leonida-shader --all-targets, default and --features diagnostics, on main and on the merge: 13 warnings on each side, the same set, none in a changed line.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md is clean on the merge.

Whole-archive translation, offline (no game run), to check the timing and the output claims:

  • cargo build --release -p leonida --locked (system heap, no features) of main and of the merge; leonida translate <shaders.rpf> with LEONIDA_HOST_RDNA=1, every logical core (32 threads), at low priority. The two builds ran alternately, 5 runs each. Other jobs were running on the PC, so wall time is noisy.
  • CPU time (user + kernel) of the process: main 1005 to 1072 s (median 1044), merge 854 to 881 s (median 862): -17 %. Wall: main 72.7 to 86.6 s (median 73.6), merge 61.3 to 84.7 s (median 66.3): -10 %. This matches the body's system-heap result against main + #2745 (-10 % wall, -12 % CPU). The diagnostics,mimalloc build was not timed here.
  • Output: one more run of each build with --list, which prints per program a hash of the emitted shader and of what the host binds for it. Both sides give the same multiset of hashes (same number of emitted programs, same number of distinct hashes, no hash differs) and the same summary of failure reasons. The only difference is which program is quoted as the example of two failure reasons, which depends on which thread gets there first.
  • Why the hasher cannot change the output by itself: std's RandomState already seeds every map at random, so a table whose iteration order reached the output would already make two runs of main differ. The new hasher only makes that order fixed.

Not covered here: the game (this changes translation time, not frame time) and the mimalloc build.

Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40, Rust 1.98.1.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7309449054 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2750#issuecomment-7309449054). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-12-01T11:18:02Z. --- Posted after the merge: the head tested below is the one that was merged. RUN (independent run on Windows, #2750 head b75e391a8, merged locally into main e56aff1ce with `git merge --no-ff`, no conflicts. #2745 is already in main, so the merge adds only the six files of this pull request. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) Commands, in `d3d12/`, target x86_64-pc-windows-msvc, toolchain 1.98.1, all with `--locked`, at low priority, `RUST_TEST_THREADS=8`: - `cargo test -p leonida-shader --no-fail-fast`: main 405 passed / 0 failed / 5 ignored; merge 408 / 0 / 5 (the 3 new `fxhash` tests). The `rdna_forms_give_what_the_spelled_out_ones_give` failure named in the body is fixed on main (#2624): it passes on both sides. - `cargo test -p leonida-shader --no-fail-fast --features diagnostics`: main 405 / 0 / 5; merge 408 / 0 / 5. - Red: on main the new tests cannot compile (there is no `fxhash` module), so the red is by mutation of the new hasher, with its tests kept: - Rotation removed from `finish` (`self.0` instead of `self.0.rotate_left(26)`): `small_number_keys_spread_over_buckets_and_tags` fails with "i * 4096: a bucket of 131072 against a mean of 32". This is the control the body describes. - Tail length dropped from `write` (`self.add(u64::from_le_bytes(word))`): `the_same_key_hashes_the_same_and_near_keys_differ` fails on `"a" and "a\0"` (the same hash for both). - Green: the file restored (`git status` clean), `cargo test -p leonida-shader --lib fxhash`: 3 passed. - `cargo clippy -p leonida-shader --all-targets`, default and `--features diagnostics`, on main and on the merge: 13 warnings on each side, the same set, none in a changed line. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md` is clean on the merge. Whole-archive translation, offline (no game run), to check the timing and the output claims: - `cargo build --release -p leonida --locked` (system heap, no features) of main and of the merge; `leonida translate <shaders.rpf>` with `LEONIDA_HOST_RDNA=1`, every logical core (32 threads), at low priority. The two builds ran alternately, 5 runs each. Other jobs were running on the PC, so wall time is noisy. - CPU time (user + kernel) of the process: main 1005 to 1072 s (median 1044), merge 854 to 881 s (median 862): -17 %. Wall: main 72.7 to 86.6 s (median 73.6), merge 61.3 to 84.7 s (median 66.3): -10 %. This matches the body's system-heap result against main + #2745 (-10 % wall, -12 % CPU). The `diagnostics,mimalloc` build was not timed here. - Output: one more run of each build with `--list`, which prints per program a hash of the emitted shader and of what the host binds for it. Both sides give the same multiset of hashes (same number of emitted programs, same number of distinct hashes, no hash differs) and the same summary of failure reasons. The only difference is which program is quoted as the example of two failure reasons, which depends on which thread gets there first. - Why the hasher cannot change the output by itself: std's `RandomState` already seeds every map at random, so a table whose iteration order reached the output would already make two runs of main differ. The new hasher only makes that order fixed. Not covered here: the game (this changes translation time, not frame time) and the `mimalloc` build. Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40, Rust 1.98.1.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2750
No description provided.