urt-rs / docs /research /ORIGINAL_MODELS_RUST_BATCH.md
nmarshall's picture
qvm: contact basis and damage dispatch
73a5d10
|
Raw History Blame Contribute Delete
7.66 kB
# Original models and Rust asset foundation: RE-692–701
Ten separately checked tasks extend the [geometry/trace batch](QVM_GEOMETRY_TRACE_BATCH.md). Original MD3 bytes now drive the recovered vertex, leaf, tag hierarchy and complete model-hit paths. The first Rust asset crate validates the complete extracted MD3 corpus. Original executable/native parity and playable rendering/gameplay remain open.
| Task | Completed scope | Evidence |
| --- | --- | --- |
| RE-692 | Bounded original-byte MD3 reader and malformed-input checks | [MD3 contract](MD3_CONTRACT.md) |
| RE-693 | Every extracted MD3 occurrence, preserving case and identity | [Corpus inventory](MD3_INVENTORY.md) |
| RE-694 | Actual initializer bindings correlated with original model/tag names | [Bindings](MD3_BINDINGS.md) |
| RE-695 | Original file byte windows through actual QVM vertex decoding | [VM bridge](MD3_VM_BRIDGE.md) |
| RE-696 | Complete leaf processing on original player models | [Original leaf geometry](MD3_ORIGINAL_LEAF.md) |
| RE-697 | Actual tag attachment and original hierarchy geometry | [Original hierarchy](MD3_ORIGINAL_HIERARCHY.md) |
| RE-698 | Complete pose-driven model hits using original hierarchy buffers | [Original model hits](MD3_ORIGINAL_MODEL_HIT.md) |
| RE-699 | Quantified source/conventional geometry differences on originals | [Numeric audit](MD3_GEOMETRY_AUDIT.md) |
| RE-700 | Contact eligibility prefix using original-model hit contexts | [Contact gates](QVM_CONTACT_GATES.md) |
| RE-701 | Safe dependency-free Rust MD3 crate, CLI and corpus parity | [Rust asset core](RUST_MD3.md) |
## Original-asset findings
Case-insensitive discovery finds619 original MD3 occurrences totaling152772340 bytes. Every occurrence passes declared range/surface/index checks and finite frame/tag/UV reads. Lowercase-only discovery found467 files. Archive/member identity, stored virtual paths and hashes remain separate; the scripts do not rename originals or choose VFS precedence. In particular, the QVM requests orion/lower_3.md3 while the archive stores lower_3.MD3, a case-sensitive Linux resolution concern.
Actual21581 initialization maps the Athena and Orion LOD3 lower/upper/head/helmet slots. Both chains use tag_torso from lower to upper, then tag_head from upper to head and head to helmet. All requested original tag names exist. Actual21770 attachment now searches those original names with recovered36306 comparison, allocates bounded child arrays and writes parent pointers; heap allocation/zero fill remain explicit models.
The original MD3 layout directly matches recovered model offsets. A sparse bridge copies original headers, names, indices and selected frame/tag byte windows verbatim into virtual memory. Unselected reads reject. Actual vertex decoding matches independent signed interpolation for all eight selected player models. Complete23092 produces source-derived hits/misses on originals at first/last frames, including lower835 and upper978. Complete25341/22009 processes original tag matrices and all model parts. Complete144766 joins actual pose, original geometry, classification, sorting and trace publication, including frame22 probes and both selector identities.
The numeric audit retains exact input report hashes. All76 sampled source points differ from conventional origin+parameter×direction by more than1e-5, with maximum comparison distance about19.83 model units. All12 sampled tag transforms differ from conventional composition only in the fourth basis row. These are measured differences between recovered source output and conventional formulas; no original executable is run to adjudicate behavior. The scripts preserve source results and leave native/reference validation open.
Contact292545 now executes its eligibility prefix with source-produced original-model hit/miss contexts. The weapon4/nonzero flag can override the damageable gate. Client contacts require a nonempty context; enabled-mode same-team contacts return zero when friendly fire is disabled. Nonclient/impact-only and accepted-client paths stop at their actual next source boundaries. No damage result or side effect is supplied.
## Rust foundation and validation
The workspace now contains the dependency-free, safe Rust library [urt-assets](../../crates/urt-assets/README.md) and urt-md3 inspection CLI. The reader borrows original bytes, checks counts/ranges/overflow, surface chains, frame agreement, indices and finite geometry, and exposes packed vertices/normal words, decoded positions, frames, tags, UVs and shaders. It embeds no assets. Build output stays under ignored target/.
The Rust CLI executes against all619 originals. Independent Python comparisons verify headers/surfaces, first/last packed samples, exact position/UV/frame/tag float bits, triangle indices and shaders. Ten offline Rust unit tests and malformed CLI probes pass. Cargo and rustc are required; set RUSTC when the compiler is outside PATH. This validation ran on macOS; Linux execution is pending. Bevy AssetLoader/scene integration and Solari rendering are not implemented in this crate.
The1218-test Python baseline gains41 checks, ending at1259 passing tests, alongside10 passing Rust unit tests. Every new report regenerates byte-identically and remains below2MiB. Earlier constructed-model and original-model reports remain byte-identical after optional resolver/limit extensions. Storage/filter, documentation-link, Rust formatting and whitespace checks pass. No original asset changes or shared VM evaluator changes occur in this batch.
## Remaining limits and next ten tasks
Original file buffers are now used directly, but native loader18183 allocation/endian/ownership behavior, original executable traces, live model/frame/clock domains, world collision, full contact/damage, networking and complete macOS/Linux Rust/Bevy/Solari gameplay remain open. RE-691 is partially complete; RE-702 tracks the next work.
1. Add a Bevy-facing MD3 asset loader around the verified Rust reader, with explicit case-folded lookup and archive-variant resolution from the inventory.
2. Port original tag/frame interpolation and hierarchy transforms into Rust with exact source-order float32 contracts and original-asset fixtures.
3. Port the verified geometry/classification contracts into Rust, keeping source/conventional differences explicit until native parity is captured.
4. Recover native loader18183 and allocation/buffer ownership, validating original headers, bounds, endian treatment and failure behavior.
5. Capture original executable/native/DLL traces for point construction, fourth-row composition, unknown names and live animation/frame selections.
6. Continue contact292545 beyond the eligibility gates through location/armor/event/damage handoffs and complete caller returns.
7. Recover289594 damage factors and211239 health/armor/team rules against actual original-model contact inputs and independent source/reference oracles.
8. Continue shared handler293732 through actual trace/contact/statistics with original-model geometry rather than supplied outcomes.
9. Recover successful295018 pellet target/location aggregation, four-target/fifteen-slot bookkeeping and contact conditions.
10. Build and validate the first interactive macOS/Linux Rust/Bevy/Solari gameplay slice, continuing maps/materials/textures/audio/network/lifecycle work and platform packaging.
Follow-up: [RE-703–712](QVM_DAMAGE_FACTOR_BATCH.md) completes289594 factor/wound logic on original contexts and the contact dispatch suffix.211239 health damage and complete292545 composition remain open; RE-702 is partially advanced and RE-713 tracks the next work.