Skip to content

docs/bvh.md: what the 0x40 instance key is not (ASSET-350) - #4525

Open
ScarionWorkspace wants to merge 2 commits into
ItsNotRexed:mainfrom
ScarionWorkspace:docs/asset-350-bvh-key
Open

ScarionWorkspace wants to merge 2 commits into
ItsNotRexed:mainfrom
ScarionWorkspace:docs/asset-350-bvh-key

Conversation

@ScarionWorkspace

Copy link
Copy Markdown
Contributor

ASSET-350. Records in docs/bvh.md §3.2 what the +0x40 key of the 208-byte instance descriptor is, measured over all 269,106 descriptors of core_bvh4.rpf. What it hashes stays Open.

  • Two uniform populations: 144,471 keys below 2^55 and 124,635 full 64-bit. The population follows the BLAS (28 of 197,324 BLAS in both).
  • Not a hash of any of the 318,149 drawable names of levels.rpf under 13 64-bit hash families. The name set is validated: Murmur3 h1 of the same names reproduces 228,610 of 228,681 archetype keys.
  • Not an entity id (1b60404d) or archetype key (c8a7b90a) of any of the 1,670,435 entities, and not shared with the 24,832 other descriptors (2 occurrences).

Measured on my own 1.0.2.1 package with tools/bvh_index.py (reproduces the §1 totals exactly), rpf9dump models over all of levels.rpf, and tools/world_index.py over the whole archive, plus local standard-library scripts for the hash comparisons. Counts only; no keys, names or game bytes.

Tested: python -I tests/test_docs_*.py (7 files, all pass). Docs only; no GPU needed. AI-assisted (Claude Code).

🤖 Generated with Claude Code

Measured over all 269,106 instance descriptors of core_bvh4.rpf: the key is
two uniform populations (below 2^55 and full 64-bit) that follow the BLAS,
is not a hash of any drawable name (name set validated against 228,610 of
228,681 archetype keys), not an entity id or archetype key, and not shared
with the other descriptor streams. What it hashes stays Open.

Counts only; no keys, names or game bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 2988cbba on Windows 11: test_docs_links.py 6 OK, test_docs_design_rows.py 2 OK; git diff --check clean.

The BVH page now records what the 0x40 instance key is not, with counts/offsets only. No blocking issue.

@kapitche

kapitche commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested 2988cbb merged with main d0835dd (no conflicts) on Linux (WSL2) Python 3.12.16: concern (docs-only; overlaps another open PR).

  • tests/test_docs_*.py (all 7): OK.
  • Arithmetic and links hold: 144,471 + 124,635 = 269,106; the 235,533 distinct keys and 269,106 descriptors agree with the existing §3.2 table; world_names.md does contain the c8a7b90a and 1b60404d rows it cites.
  • Overlap and mismatch with docs/bvh.md: where the BLAS of the §4a interior's other entities are (ASSET-351) #4506, which also adds a paragraph on the +0x40 key to docs/bvh.md (§4a, "The descriptor key"): that one says "1,008 (BLAS header, transform) pairs occur under more than one key, up to 60 keys", this one says "11,209 of the 211,407 (crc32, transform) pairs carry more than one key, up to 743". The identities differ (stored header vs stream crc32), but both read as the same observation on the same 269,106 descriptors, so one of the two (or the definitions) needs reconciling (the two branches merge without a textual conflict, so nothing flags it).
  • The 55-bit / 64-bit populations, the 0-of-235,533 hash search and the 24,832 other-descriptor count need the game; not repeated.

@Krashgamer

Copy link
Copy Markdown
Contributor

@kapitche, about the +0x40 overlap you raised: that paragraph ("1,008 (BLAS header, transform) pairs … up to 60 keys") is #4265's (ASSET-322, @NiiRoZz). #4506 shows it only because its branch is built on #4265 (Depends on: #4265), and #4506's own commits don't touch it. Reconciling the two definitions (stored header vs stream crc32) is therefore between this PR and #4265.

…350)

Give the count keyed by the stored BLAS header (sizes, bounds, crc32) and
transform, the identity ItsNotRexed#4265 uses: 1,030 pairs carry more than one key, up
to 60 (ItsNotRexed#4265: 1,008). Keep the crc32-only count after it.

AI-assisted. tests/test_docs_*.py: 7/7 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ScarionWorkspace

Copy link
Copy Markdown
Contributor Author

@kapitche thanks. The two counts use different identities: this PR grouped by the stream crc32 + transform, #4265 by the stored BLAS header (sizes, bounds, crc32) + transform. Recounted with #4265's identity on the same 269,106 descriptors: 1,030 pairs carry more than one key, up to 60 (#4265: 1,008, up to 60). Adding any further header field gives 1,029–1,030, so the remaining ~20 is most likely in how descriptors are paired with their BLAS. The bullet now gives the header-based count first and the crc32-only one second (follow-up commit on this branch). AI-assisted; doc tests 7/7 OK.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 8c838c1 merged with main 98fa503 on Linux (WSL2), Python 3.12.16: concern (docs only)

  • tests/test_docs_*.py (all 10 files): OK.
  • Arithmetic checked: 144,471 + 124,635 = 269,106; 1,030 - 1,008 = 22 ("about 20"); 124,635 / 512 = 243.4, so "about 244 by chance" holds for the 64-bit population only (for all 269,106 keys it would be about 526), worth saying which; 235,533, 269,106, 24,832, 1,670,435, 228,681 and 343,327 agree with other docs pages.
  • Dangling references: "§4a's count with the same identity is 1,008" and "the one exception already noted in the ASSET-350 finding" point to text that is not in docs/bvh.md on main (§4a has no descriptor-key count; "ASSET-350" occurs only in this PR's heading). docs/bvh.md: where the BLAS of the §4a interior's other entities are (ASSET-351) #4506, which adds the §4a paragraph, is still open, so this PR's cross-reference only resolves if it merges first (or the reference should be dropped).
  • Not backed by anything in the repo: 1,664,626 distinct entity ids (docs have 1,670,435 entities only) and "228,610 of the 228,681" archetype keys reproduced by Murmur3 h1. The other measurements need the game and were not repeated.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at 2988cbba6 on Windows 11: test_docs_links.py 6 OK, test_docs_table_rows.py 2 OK; git diff --check clean.

The new 0x40 key section records a real measurement over all 269,106 descriptors (197,324 distinct BLAS crc32): two key populations (144,471 under 2^55, 124,635 full 64-bit) that follow the BLAS and come in file-order runs, one key per (BLAS, transform) with the noted exception, and the negative results against 318,149 drawable names (Murmur3/xxh64/FNV/joaat64/CRC-64/MD5/SHA/BLAKE2b, full/masked/shifted), 1.66M entity ids and 228,681 archetype keys. The conclusion is left Open, which is honest. I cannot recount the archive here; the tables/links validate. No blocking issue.

@memorypressure

Copy link
Copy Markdown

Docs-only, merges cleanly with main, and the docs scanners pass with the new ASSET-350 section — no untracked paths or unimplemented flags backticked, and no new table-escape traps (re-run). The census counts are measurements over the BVH package and cannot be re-derived here. The PR shows no CI checks at all — worth triggering since the scanners exist. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

ItsNotRexed added a commit that referenced this pull request Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed documentation in PR #4525: docs/bvh.md: what the 0x40 instance key is not (ASSET-350).

Scope: docs/bvh.md
Diff: +33 / -0 across 1 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @ScarionWorkspace - I went through docs/bvh.md: what the 0x40 instance key is not (ASSET-350) and the diff around docs/bvh.md. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants