instance_lists: count grass and prop records in bulk (OLD-10049) #1161
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1161
Loading…
Reference in a new issue
No description provided.
Delete branch "perf/bulk-instance-counts-10049"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: OLD-10049 (claim).
Depends on: none.
What changed
Carries forward tedin7's commit from draft #315 onto
6293c1c4f, retaining the original author.tools/instance_lists.pycounts grass byte fields in bulk and unpacks prop matrices in batches while scanning map resources.The second commit fixes two differences from the record-by-record implementation that showed up during the port. A complete final prop matrix can lack some or all of its trailing record padding. The draft raised
struct.errorin that case. The second difference was numerical: changing how the squared axis lengths were summed flipped the handedness count for a synthetic singular matrix on CPython 3.12. The port now preserves the original rounding for axis lengths and dot products. Regression tests cover both cases.Measurements
Windows 11 x64, Ryzen 5 9600X, CPython 3.12.10. Each synthetic list contained 65,535 instances. The table gives median elapsed time over eight paired runs with alternating order, excluding fixture creation. All count dictionaries matched the parent. Every pair favored the PR.
These measurements cover the instance-counting functions used by the offline analysis tool.
Tested
6293c1c4facross 12,075 additional synthetic combinations of buffer length, record stride and member offset.test_instance_lists.pyandtest_instance_lists_schema_gap.py: 22 tests passed on each of CPython 3.10 and 3.12. The carried-over grass speed test failed on the parent, and the new matrix cases reproduced both regressions before the second commit.0cbc40239applied cleanly. All 83 tests acrosstest_instance_lists,test_instance_lists_schema_gap,test_world_interior_namesandtest_world_lights_pathspassed together.GPUs tested: n/a (CPU-only). Only synthetic inputs were used.
AI-assisted: yes (OpenAI Codex).
Checklist
mainand merges cleanly.Reviewed and verified. Impressive performance optimization in
tools/instance_lists.py(OLD-10049) bulk-counting grass records and batch-unpacking prop matrices (3.16x - 12.59x speedup). Correctly handles partial trailing padding and preserves exact matrix handedness rounding. Validated against 12,075 synthetic combinations intest_instance_lists.py(22/22 PASS). 100% clean-room.Verified
d69a50c24on Arch Linux (Python 3.14):python3 -m unittest tests/test_instance_lists.py: 20 tests passed (0.768 s)AI-assisted: yes
Recommendation: [MERGE]
Reasoning: Carries #315:
instance_listscounts grass bytes and unpacks prop matrices in bulk, plus a second commit restoring two behaviours the draft changed (missing trailing padding, etc.). Tool change with a 146-line parity test. Verified by madhyn (20 tests). CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict withmain. Merge once the queued checks are green.Impact level: 3/10
Red/green: tests/test_instance_lists.py 1 failed on main (bulk read not 4x faster), 21 passed with the PR.
Targeted batch of 30 PRs (their tests, the tests importing the changed modules, the docs tests, the translator suite) on main a997a3c: no new failure, Windows 11 / Python.
AI-assisted (Claude Code, Claude Opus 5.5)