Skip to content

Reuse exact fixed-ink face meshes across Sheet replays (#2207) - #2217

Merged
pzfreo merged 4 commits into
mainfrom
perf/2207-fixed-ink-mesh-cache
Oct 7, 2026
Merged

pzfreo merged 4 commits into
mainfrom
perf/2207-fixed-ink-mesh-cache

Conversation

@pzfreo

@pzfreo pzfreo commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Adds an opt-in, caller-owned FixedInkMeshCache to Sheet.build() for repeated interactive replays. Cache keys include the exact located B-rep of each rendered annotation face and tessellation tolerance. Failed keys or cache operations fall back to ordinary validation; entries are bounded and can be cleared. Normal uncached builds do not serialize cache keys.

Representative Specify PMI plate retime (one process, same Sheet): cached cold 32.537 s; cached warm 26.540 s (1,168 additional hits, zero new misses); uncached warm 39.146 s. The cached warm replay saved 12.606 s (32%) in this single run. All three builds had the same 51 annotation names and 13 lint code/severity pairs. The linked #2207 issue has the detailed evidence. A GRM04 warm replay showed 5.785 s cached versus 6.990 s uncached.

Focused tests cover identical and moved ink, tolerance separation, cache failures, LRU eviction, replay, bounds, and type validation. Prior local checks: 220 relevant tests, targeted mypy/Ruff, strict docs build, and 97% changed-line coverage. The branch has been rebased locally onto current main with the eviction assertion and focused cache tests passing; it will be pushed once #2216 lands to avoid redundant CI. Close #2207 only after this PR merges green.

@pzfreo

pzfreo commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Additional local replay measurement on GRM04 corpus plate: cached warm 5.785 s versus uncached warm 6.990 s in the same process (280 mesh hits; identical annotations and lint). This is an indicative ~17% warm-replay saving, with run-to-run timing variation; #2207 records full context. The original Specify plate remains unmeasured, so this is not a claim of its estimated four-second gain.

@pzfreo

pzfreo commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Representative retiming is now in #2207: exact Specify plate PMI Sheet script, cached warm 26.540 s versus uncached warm 39.146 s in the same process (12.606 s / 32% faster in one run), with identical annotation names and lint code/severity pairs. This exceeds the original estimated saving, but remains a single-run measurement rather than a stable benchmark.

@pzfreo

pzfreo commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Representative Specify PMI plate retime (same Sheet, one process): cached cold 32.537 s; cached warm 26.540 s with 1,168 further cache hits and zero new misses; uncached warm 39.146 s. Cached warm was 12.606 s (32%) faster in this single run. All three builds had the same 51 annotation names and 13 lint code/severity pairs. The linked #2207 issue has the detailed run evidence. The branch also has an unpushed LRU eviction assertion; I will include it with the post-#2216 main update to avoid two redundant CI runs.

@pzfreo
pzfreo force-pushed the perf/2207-fixed-ink-mesh-cache branch from f4a6f7b to df6bee2 Compare October 7, 2026 02:51
@pzfreo
pzfreo merged commit 2be1e51 into main Oct 7, 2026
19 checks passed
@pzfreo
pzfreo deleted the perf/2207-fixed-ink-mesh-cache branch October 7, 2026 03:48
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.

Rebuild faster after an annotation-only edit: reuse fixed-ink face meshes across rebuilds

1 participant