mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #1161] instance_lists: count grass and prop records in bulk (OLD-10049) #1194
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1194
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1161
Author: @sodove
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:perf/bulk-instance-counts-10049📝 Commits (2)
f6691dbperf: read grass and prop instance lists in bulk in instance_listsd69a50cKeep prop counts stable at matrix and buffer boundaries📊 Changes
3 files changed (+225 additions, -31 deletions)
View changed files
📝
docs/world.md(+4 -1)📝
tests/test_instance_lists.py(+146 -0)📝
tools/instance_lists.py(+75 -30)📄 Description
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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.