mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #140] tools/native: unified zero-dependency Rust workspace for 8 hot accelerators (13x-228x, Python fallback) #192
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#192
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/140
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9872📝 Commits (1)
20e7ccdtools/native: one Cargo workspace for eight Rust accelerators📊 Changes
60 files changed (+13510 additions, -11 deletions)
View changed files
📝
.github/workflows/ci.yml(+32 -0)➕
tests/test_anim_clips_native.py(+250 -0)➕
tests/test_bc7_native.py(+143 -0)➕
tests/test_bvh_native.py(+282 -0)➕
tests/test_glb_native.py(+379 -0)➕
tests/test_meshlet_native.py(+305 -0)➕
tests/test_native_workspace.py(+89 -0)➕
tests/test_rdna2_decode_native.py(+402 -0)➕
tests/test_spirv_asm_native.py(+305 -0)➕
tests/test_spirv_opt_native.py(+541 -0)➕
tools/_anim_clips_native.py(+117 -0)📝
tools/anim_clips.py(+17 -7)➕
tools/anim_clips_native/.gitignore(+1 -0)➕
tools/anim_clips_native/Cargo.toml(+9 -0)➕
tools/anim_clips_native/README.md(+25 -0)➕
tools/anim_clips_native/src/lib.rs(+664 -0)➕
tools/bc7_native/.gitignore(+1 -0)➕
tools/bc7_native/Cargo.toml(+11 -0)➕
tools/bc7_native/README.md(+30 -0)➕
tools/bc7_native/src/lib.rs(+377 -0)...and 40 more files
📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Unified zero-dependency Rust Cargo workspace (
tools/native/Cargo.toml) consolidating our 8 highest-impact optional native accelerators (replacing closed PRs#8447,#8638,#8654,#8751,#8761,#8808,#8936, and#9645) into one single workspace build, one CI step, and one globalLEONIDA_NATIVE=0kill-switch (plus per-moduleLEONIDA_*_NATIVE=0), with automatic byte-identical pure-Python fallback everywhere.Included Crates (0 external dependencies, Rust 1.85+,
catch_unwindFFI guards,try_reserve_exact)rdna2_decode_nativetools/rdna2_decode.py32.33 s -> 0.64 son 2,000 real shaders)spirv_asm_nativetools/spirv_asm.py24.59 s -> 1.78 son 500 modules / 408 MiB)spirv_opt_nativetools/spirv_opt.py102.35 s -> 7.41 son 500 modules)bvh_nativetools/bvh_rehydrate.py0.344 s -> 0.004 s) / 130–228x syntheticbc7_nativetools/dds_png.py5.9 s -> 43 mson 2048x2048 BC7)meshlet_nativetools/meshlet_page.py25.2 s -> 0.27 son 2.03M tris)anim_clips_nativetools/anim_clips.pyglb_nativetools/glb_writer.pypack_primitive/ 10–18xbuild_glbhypot+ 1.37M mesh calls (0 mismatches)(Real-corpus checks were read-only on personal 1.0.2.1 copies — counts and timings only, no game data.)
Unified Build & Fallback
cargo build --release --workspace --locked --offline --manifest-path tools/native/Cargo.tomltools/native/target/release/first, then per-cratetarget/release/, and falls back transparently to pure Python if unbuilt,LEONIDA_NATIVE=0, orLEONIDA_<MODULE>_NATIVE=0..github/workflows/ci.yml(--locked --offlinewith-D warnings) andtests/test_native_workspace.py.Testing (Windows 11, Ryzen 9 5900X, Rust 1.100.0, Python 3.12.10, CPU only)
RUSTFLAGS="-D warnings" cargo build --release --workspace --locked --offline --manifest-path tools/native/Cargo.toml: 0 warnings.RUSTFLAGS="-D warnings" cargo test --release --workspace --locked --offline --manifest-path tools/native/Cargo.toml: 45/45 passed.102/102tests OK) +test_native_workspace.py(4/4OK) + all 9 pure-Python reference suites pass.compileall,make_game.py --help,scripts/check_no_game_data.py, andgit diff --checkall clean. No game data used.AI-assisted (Claude Opus 5.5).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.