Repository navigation
Conversation
A consistent candidate does not prove every geometry it names: the checks see bounds, stored box overrides and paired edges, not where a leaf is, so a small geometry inside the bounds can be swapped for another of the same triangle count unnoticed. For the best candidate, bvh_match.py now runs those replacements (--pin-checks, default 128) and names every index one of them also passes. An index is called pinned only when every replacement was run; one past the cap or without an OBJ group is reported as not run. docs/bvh.md: with every replacement run, the render-bucket rule gives the kept set exactly in all 1,444 of 1,562 rule-independent matches whose indices are pinned; the remaining exception and 15 re-found exceptions differ only on unpinned indices, so none establishes a kept bucket-1/2 geometry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Tested
Both incomplete searches explicitly left the remaining index unresolved. Each fixture used one synthetic model. CPU only. AI-assisted with Codex. |
Contributor
|
Tested ecf4554 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: ASSET-566 (ASSET-349 follow-up, assigned in #6603; listed in #7333)
Depends on: none.
test_bvh_slot_checkandtest_text_write_line_endingsfail onmainindependently of this PR(#6513 fixes the first).
What and why
#6330 made the render-bucket rule the default and listed exceptions: BLAS that seem to keep a bucket-1 or bucket-2
geometry. A consistent candidate does not prove every geometry it names, though. The checks see the bounds, the stored
box overrides and the paired edges, not where a leaf is, so a small geometry inside the bounds can be swapped for
another of the same triangle count without any check noticing.
tools/bvh_match.py: for the best consistent candidate, each geometry index is tried with every other geometry ofthe same model with the same triangle count (including geometries the rules leave out and ones the candidate uses at
another index), and every index that such a replacement also passes is reported as not pinned. An index is called
pinned only when every replacement was run; a replacement past
--pin-checks N(default 128, 0 skips) or withoutan OBJ group is not run, and the output then says the remaining indices are not known to be pinned. The
--jsonreport gains
pinning(complete,unpinned,alternatives,tried,not_tried,no_obj_group). When nocandidate fits under the bucket rule, the output points at
--no-bucket-rule.docs/bvh.md§4a: which exceptions are established, with the measurement below; §7: the option and its output;the Open item now asks what fills the extra index.
Measured (1.0.2.1 package, counts only; no game data in this PR)
Ground truth with no rule (
--no-bucket-rule, exactly one consistent match) for the BLAS among the first 2,908core_bvh4.rpfstreams with at least two geometry indices, against thelevels.rpfwindows at 3 and 4 GiB. Everyreplacement was run (no cap); no replacement lacked its OBJ group.
11 indices where the rule keeps 10; the checks pass with the bucket-3 quad in either of the last two places or both,
so it shows one index more than the rule keeps, not a kept decal. No other first-LOD model of
levels.rpf,data.rpforpacks.rpfhas its signature.Over 8 windows holding 228 of them (all replacements run), 213 have no consistent candidate and 15 have one that
keeps the flipped geometry; in all 15 that index is not pinned. None of the 16 cases establishes that the BVH keeps
a bucket-1 or bucket-2 geometry. bvh_match: leave out geometries by render bucket (ASSET-349) #6330's own 22 were not rerun (they come from a whole-archive export);
bvh_match.pywith the default--pin-checkswould settle them.The largest sample (62,479 leaves) runs in 3.8 s with the check.
Tested
python -I tests/test_bvh_match.py: 48 OK; 8 new synthetic tests (unpinned quads, a left-out geometry as areplacement, a fully pinned match, the
--jsonfields, the cap, a replacement without an OBJ group, the--no-bucket-rulehint and its absence), 6 of which fail againstmain's tool.test_bvh_geometry_check,test_bvh_rehydrate,test_bvh_index,test_sgd5_effects, thetest_docs_*checks,test_check_no_game_data,test_resource_hygiene: OK.python -m compileall -q make_game.py tools tests,python -I make_game.py --help,python -I scripts/check_no_game_data.py(exit 0),git diff --check: OK.mainalready, unchanged here (checked against a clean copy ofmain):test_bvh_slot_check(3 errors, bvh_slot_check: unpack 6-tuple from model_geometries() after #6330 #6513) and
test_text_write_line_endings(tools/f64_omod_probe.py:268,tools/leonida_tui.py:753).AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed: not applicable.🤖 Generated with Claude Code