Files
mandy/d3d12/docs/asset-policy.md
NotRexed fee07ff779 d3d12: Leonida's D3D12 runtime under its own name
What changed:
- victory/ is now d3d12/;
- its crates are leonida-* (leonida_* code paths);
- the program is leonida.exe;
- settings are LEONIDA_*, and the older VICTORY_* names still work through apps/leonida/src/leonida.rs;
- the config file is leonida.toml;
- log names and user-facing text say Leonida.

What did not change: lines that credit upstream projects or people, URLs, copyright notices and the
GPL-3.0 LICENSE. d3d12/README.md opens with a Leonida section that says the runtime grew from
Marvisak/VIctory through trustno1-coder/VIctory-NVIDIA. The rest of that README is labelled as
trustno1-coder's.

The launchers (scripts/play-d3d12.ps1, scripts/play-linux.sh), docs/linux.md and
scripts/sync_victory.py (prefix d3d12) follow the move. Future upstream merges will need a
mapping from upstream's names onto these.

Builds with `cargo build --profile diag -p leonida --features diagnostics`. The settings alias
tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 16:11:32 -05:00

61 lines
2.5 KiB
Markdown

# Asset policy (rule #1)
**Nothing from the game is ever stored in this repository.** Everything is
built on the user's machine from files the user supplies. The same applies
to other titles used for testing, and to any other proprietary material.
## Not allowed
In any form (files, string literals, fixtures, snapshots, docs):
* assets: models, textures, shaders, audio, video, text, archives;
* the executable or any part of it: data sections, strings, tables,
resources, code beyond the signatures below;
* anything derived from those: converted assets, decompiled or
disassembled code, shader dumps, extracted tables, screenshots.
## Allowed
* our own code that understands formats;
* build identities: BLAKE3 of an executable, CodeView GUID/age;
* per-build offsets of functions we hook, under names we choose;
* byte-pattern signatures that locate functions or data in the executable;
* small interoperability constants (magic numbers, enum values) we write;
* synthetic test data generated by our own code.
## The one exception
`crates/leonida-formats/src/bcpack-tables.bin` (about 78 KB): the constant
tables of the BCPack format (entropy models, index rank tables, control
codes, per-format dictionaries). A BCPack stream cannot be decoded without
exactly these tables and they cannot be derived, so they ship with Leonida
by the project owner's decision (2026-11-23), entered as an exception in
`xtask/src/policy.rs`. They are part of the format, not our work, and the
repository's licence does not cover them. Nothing else of this kind is
accepted.
## Where data lives
Outside the repository, configured in `leonida.toml`: `game_dir` (the
user's dump), `test_titles`, and `cache_dir` for everything derived
(default `%LOCALAPPDATA%\leonida\cache`).
## Enforcement
1. `.gitignore` keeps common data types out of `git status`.
2. `cargo xtask policy` (run by the pre-commit hook; install with
`cargo xtask install-hooks`) is an allowlist: files must have an allowed
type, be under 640 KiB, contain no binary data or known binary
signatures, and hold no long hex/base64 runs. Exceptions need an entry
with a reason in `xtask/src/policy.rs`.
3. At runtime, everything that writes derived data calls
`leonida_core::ensure_outside_repo`.
4. Tests that need real files take their paths from environment variables
and skip when unset. They assert on properties, never on snapshots.
## If something slips through
A follow-up commit is not enough. Rewrite history
(`git filter-repo --path <file> --invert-paths`), force-push, and have
everyone re-clone.