upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/models.md
diff options
context:
space:
mode:
authorKacper Serewiś <kacper@serewis.nl>2026-11-23 16:37:15 +0100
committerGitHub <noreply@github.com>2026-11-23 09:37:15 -0600
commitc1aa89e0ffa89b88ca3e7dafb77bc87e71eb9ff2 (patch)
tree21b6ca180c5c7963865e1d42d7f752e1acab0d5c /docs/models.md
parent01f8116d1b58f7fe632ac92a9a51bdd990a8fecc (diff)
BUILD-2389: verify keyed drawable offset predictions against exported models (#6900)
Squash-merged after diff review of PR #6900 - BUILD-2389: verify keyed drawable offset predictions against exported models
Diffstat (limited to 'docs/models.md')
-rw-r--r--docs/models.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/models.md b/docs/models.md
index fd783dd36..5c29b2332 100644
--- a/docs/models.md
+++ b/docs/models.md
@@ -829,3 +829,32 @@ geometry from the BIN chunk. Standard library only; no game files.
829 `levels.rpf` has the same 343,327 rows in a full export (50,731 fragments, 2,509,947,536 829 `levels.rpf` has the same 343,327 rows in a full export (50,731 fragments, 2,509,947,536
830 triangles). 830 triangles).
8314. Keep the README and issue #29 in sync with the new counts. 8314. Keep the README and issue #29 in sync with the new counts.
832
833### Predict model offsets for placements
834
835Run `python -I tools/world_drawable_lookup.py entities.jsonl archetypes.json names.json`
836with the placement rows from `world_index.py --entities-out`, the definitions from
837`world_archetypes.py`, and a bounded `rpf9_names.py --types dr,ft` report. The command
838prints local scratch JSON. Supply `--manifest path/to/models/manifest.json` for each
839existing export whose listed identities should be excluded.
840
841The lookup requires agreement between the placement archetype, the definition's name and
842assetName, the resource stem's joaat and its 64-bit placement key. It considers type 1
843fragments and type 2 drawables at page offset +16. Multiple offsets for an identity in
844the indexed window are marked ambiguous. Even a single hit is a prediction: a stream
845can mention another model. Export a window around the predicted offset with
846`rpf9dump models <archive> <outdir> --start BYTES --length BYTES`, compare the manifest offset and
847model identity and run `world_build.py --placements` with the exported geometry.
848
849Save the lookup JSON and run
850`python -I tools/world_drawable_verify.py lookup.json first/models/manifest.json second/models/manifest.json`
851to verify single-offset predictions. Supply completed normal model manifests from the
852same source archive. The verifier reads cached JSON only. It uses the world builder's
853name hashes and counts each identity and its placements once. A matching offset and both
854hashes confirm an observation, including dictionary children sharing an offset. The local
855report counts repeat exact observations and lists other offsets for the same identity.
856Without an exact match, a different name at the offset takes precedence over a matching
857identity elsewhere. The coverage flag independently records whether the predicted offset
858falls in a supplied scan (start inclusive, end exclusive). A full scan covers all offsets.
859A covered prediction with no named evidence remains missing. Geometry loadability is
860checked separately by running the normal world builder on confirmed placement rows.