texture: 8-lane hardware AES-NI texture digest #442
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!442
Loading…
Reference in a new issue
No description provided.
Delete branch "Paliton/Darner-fork:pr/aes-texture-digest"
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?
Contributor role (optional)
What it changes
texture::digest(crates/darner-gpu/src/texture.rs) hashes texture payloads in software using 4 lanes of 64-bit folded multiplications over 64-byte chunks on every texture change check.Ports the 8-lane hardware AES-NI 128-bit digest (
digest_aes, 128 bytes/iteration via_mm_aesenc_si128) fromProjectLeonida/mandy640b0d0df(PR #2802,bobcatchris, GPL-3.0), runtime-dispatched viais_x86_feature_detected!("aes")with the existingdigest_foldedkept as fallback.How it was tested
Tested revision:
5d5f4f4(based onf3840d7)Commands and results:
cargo xtask policy->asset policy: 555 files okcargo clippy --workspace --all-targets --locked -- -D warnings-> ok (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings-> ok (0 warnings)cargo test -p darner-gpu --lib --locked a_digest_tells_bytes_apart -- --test-threads=1->1 passed; 0 failed(verifies length sensitivity, single-byte flips, and adjacent byte swaps across 0..400 bytes)cargo test --workspace --locked-> all non-flaky tests pass (1772/1773indarner-gpu; the single failure is the pre-existinggpu_owned::tests::concurrent_faults_on_same_block_serialize_single_readbackflake fixed by #261)Changes a default: yes (automatic AES-NI dispatch on x86_64 CPUs with AES-NI;
Digestis in-memory only and not persisted across runs).A/B result:
Isolated CPU microbenchmark (
rustc -O, Intel Core i7-14700KF, 2 runs):digest_folded)digest_aes)In-game A/B (2 runs each, 240 s automated opening sequence,
--profile diag --features diagnostics, pureplay-defaults, RTX 5070 12 GB + i7-14700KF, Series X, 1440p -> 4K, DLSS off, FG off, RT off). Because this rig is GPU-bound and steady-statetex_refresh_msis already<0.05 ms/frameon an i7-14700KF, full-run FPS is at parity within run-to-run variance, with slightly lowerprep_msand zero stale/corrupted textures:f3840d7)5d5f4f4)prep_ms(mean)Gates run on that revision: all three
AGENTS.mdgates +cargo xtask policyon5d5f4f4.Gameplay, when relevant: RTX 5070 12 GB + i7-14700KF, Series X, 1440p -> 4K, DLSS off, FG off, RT off. Texture uploads/refreshes clean, zero stale textures.
Hardware dependence: x86_64 CPUs with AES-NI (safe
digest_foldedfallback elsewhere).Coverage gaps: in-game A/B was run on a GPU-bound system; larger in-game CPU savings would show on slower CPUs or heavier texture-streaming scenes.
Checklist
main.docs/asset-policy.md.Checked for overlap
crates/darner-gpu/src/texture.rs, non-overlapping lines)Test report, together with #440 (both merged on A): no measurable change in this scene, and nothing wrong on screen.
PC: RTX 4080 16 GB (driver 621.40), i7-13700K (24 logical processors), 64 GB, Windows 11 26300. Series X profile, 1440p with DLSS Quality, frame generation off, hardware ray tracing on, Reflex off,
DARNER_ALIAS_SHARE=1,DARNER_D3D12_BACKGROUND=0.Method: the opening scene of one save, entered the same way every run (no input after the start screen); medians of per-second values from the host log in three 45-second windows from the moment the world appears; warm pipelines; one run each. A = main
47d21cd+ #334, #337, #457, #274, #397, #312, #304, #303, #438, #439.f24eeae) + #442 (c971d13)The merge got about 0.05 ms a frame (3%) faster, within the spread; the scene is static, so little is merged or re-hashed.
Not tested: more than one run each, scenes with streaming (driving), other CPUs.
Tested merged on
c8258f9on Intel Core Ultra 7 265KF (AES-NI) + RTX 5070 Ti across 3 full Series X sessions (up to537,076texture uploads /26,087 MBin 30k+ frames): zero digest mismatches or corruption,clippy --all-features -D warningsand all unit tests passed cleanly.[pr-performance][memory] texture: 8-lane hardware AES-NI texture digestto texture: 8-lane hardware AES-NI texture digestTest needed — commit
c971d13f; what to check:texture::digest(crates/darner-gpu/src/texture.rs) hashes texture payloads in software using 4 lanes of 64-bit folded multiplications over 64-byte chunks on every texture change check.Ports the 8-lane hardware AES-NI 128-bit digest (
digest_aes, 128 bytes/iteration via_mm_aesenc_si128) fromProjectLeonida/mandy640b0d0df(PR #2802,bobcatchris, GPL-3.0), runtime-dispatched viais_x86_feature_detected!("aes")with the existingdigest_foldedkept as fallback.Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.