Branch: refs/heads/avar2-instancing
Home:
https://github.com/fonttools/fonttools
Commit: c8d3dc0e88d5662a10f560d030aaa1518aa7c16e
https://github.com/fonttools/fonttools/commit/c8d3dc0e88d5662a10f560d030aaa1518aa7c16e
Author: Behdad Esfahbod <
beh...@behdad.org>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
M Lib/fontTools/varLib/varStore.py
Log Message:
-----------
[varStore] Cache region supports; reuse one instancer in getExtremes
VarStoreInstancer recomputed each region's support dict on every scalar lookup,
and cleared it together with the (location-dependent) scalar cache on every
setLocation. Region supports are location-independent, so cache them for the
instancer's lifetime and recompute only the scalars.
VarStore.getExtremes built a fresh VarStoreInstancer for every one of the many
locations it evaluates (and recursion multiplies this). Build one instancer and
thread it through the recursion, moving it with setLocation. Together these cut
~3.3M redundant get_support calls per partial-instancing of the 12-axis
Amstelvar-avar2 test font to a handful.
Pure speedup: instanced output is byte-identical (verified by TTX hash across
several avar2 partial-instancing scenarios, including culling-heavy ones).
Partial-instancing that font drops from ~360ms to ~157ms (2.3x); the win scales
with the number of regions and reachable-range (getExtremes) work.
Co-Authored-By: Claude Opus 4.8 (1M context) <
nor...@anthropic.com>
Commit: 927baa119a3b2ccf568159a6d5244f8ae982d382
https://github.com/fonttools/fonttools/commit/927baa119a3b2ccf568159a6d5244f8ae982d382
Author: Behdad Esfahbod <
beh...@behdad.org>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
M Tests/varLib/instancer/instancer_test.py
Log Message:
-----------
[instancer] Add fast exhaustive avar2 offset-compensation test
Sweep every single-axis and pairwise restriction (12 + 66) with a moved default
and assert the partial instance reproduces the original font's final normalized
coordinates at interior user locations, using the spec-pipeline oracle.
Region culling (the getExtremes reachable-range step) is orthogonal to offset
compensation and dominates instancing time, so monkeypatch it off for this
broad sweep; culling stays covered by the other avar2 tests. Runs in ~0.5s.
Co-Authored-By: Claude Opus 4.8 (1M context) <
nor...@anthropic.com>
Commit: ad2849818b1c57924f9861d1021985da099571cd
https://github.com/fonttools/fonttools/commit/ad2849818b1c57924f9861d1021985da099571cd
Author: Behdad Esfahbod <
beh...@behdad.org>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
M Lib/fontTools/varLib/varStore.py
Log Message:
-----------
[varStore] Memoize getExtremes delta evaluations per (region, loc)
getExtremes evaluated the same raw delta at the same location thousands of
times: the nullAxes recursion re-visits identical locations, and for the
12-axis Amstelvar-avar2 test font this meant ~11k VarStoreInstancer lookups
collapsing to only ~135 distinct (varidx, location) pairs (~80x repetition).
An evaluated location is fully determined by (regionIndex, loc): a region is
only evaluated when none of its peak axes are in nullAxes, so all its peaks are
set and loc (the identity-axis coordinate) is the only remaining degree of
freedom; nullAxes decides whether to evaluate, not the location's contents.
Memoize the raw delta keyed by that pair. The cache is scoped to the top-level
getExtremes call and discarded on return, so -- unlike caching in
VarStoreInstancer itself -- it cannot grow unbounded for ordinary readers that
set one location and read many varidxs.
Pure speedup, output byte-identical (verified by TTX hash across avar2 partial-
instancing scenarios). Combined with the earlier support/instancer-reuse change,
partial-instancing that font drops from ~360ms to ~37ms (~9.6x).
Co-Authored-By: Claude Opus 4.8 (1M context) <
nor...@anthropic.com>
Commit: 4c8a560c1ac235b0b8a3a4d855378b7eb1248d79
https://github.com/fonttools/fonttools/commit/4c8a560c1ac235b0b8a3a4d855378b7eb1248d79
Author: Behdad Esfahbod <
beh...@behdad.org>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
M Tests/varLib/instancer/instancer_test.py
Log Message:
-----------
[instancer] Drop culling monkeypatch from exhaustive avar2 test
The exhaustive offset-compensation sweep disabled region culling to stay fast.
Now that getExtremes is ~9.6x faster, the full partial-instancing path runs the
78-scenario sweep in ~2.9s, so run it unmodified: no monkeypatch, and it now
also smoke-tests that culling/getExtremes runs cleanly across many axis combos.
Co-Authored-By: Claude Opus 4.8 (1M context) <
nor...@anthropic.com>
Compare:
https://github.com/fonttools/fonttools/compare/3382ab806176...4c8a560c1ac2
To unsubscribe from these emails, change your notification settings at
https://github.com/fonttools/fonttools/settings/notifications