Garret Rieger
79eaa217ac
[repacker] remove unused include.
2024-03-14 21:22:22 +00:00
Garret Rieger
025f52769f
[repacker] fix mem leak in test-classdef-graph test.
2024-03-09 00:32:36 +00:00
Garret Rieger
8e1beefe05
[repacker] small fixes.
2024-03-08 22:05:20 +00:00
Garret Rieger
17b37f10d5
[repacker] add classdef size est. test that you can add the same class multiple times.
2024-03-08 22:01:05 +00:00
Garret Rieger
0ac9e7da39
[repacker] in classdef estimator tests compare results to actual class def serialization.
...
Fix the estimator to actually match real serialization sizes.
2024-03-08 21:53:10 +00:00
Garret Rieger
8129b21dea
Update classdef size estimator to pick the min coverage format.
...
Previously this just assumed a worst case format 1.
2024-03-08 20:15:43 +00:00
Garret Rieger
252a926fbf
[repacker] Rework how ClassDef sizes are estimated during splitting.
...
The old approach considered only one class at a time, which in some cases can generate the wrong answer. This change updates the estimation to consider how all classes in the current split would end up encoded in a single ClassDef table. Additionally compute whether glyphs are consecutive only for the current split (instead of the fully mapping).
2024-03-08 19:46:48 +00:00
Garret Rieger
7160c5b9e5
[repacker] add tests for multi-duplication.
...
Further improve the resolution attempt by pre-emptively raising priority of a duplicated shared node.
2023-12-05 16:25:12 -05:00
Garret Rieger
6f64fa75e3
[repacker] improve resolution of overflows to shared nodes.
...
Prior to this change overflows to shared nodes were handled by duplicating the link from only a single parent on each iteration. However, I've encountered fonts where there is a large number of parents sharing a single child. Using the prior strategy requires large number of overflow resolution iterations to resolve overflows. This changes shared overflow resolution to duplicate the shared child and re-assign multiple overflowing parents in a single iteration. This reduces total packing size in these cases and allows resolution to complete in far fewer iterations.
2023-12-05 16:25:12 -05:00
Behdad Esfahbod
330c32f902
[graph] Another preallocation
2023-11-10 12:27:48 -07:00
Behdad Esfahbod
9c4d3c3c70
[graph] Pre-alloc priority-heap array
2023-11-10 12:26:02 -07:00
Behdad Esfahbod
3a9262cc3d
[sanitize] More hb_barrier() annotations
2023-11-04 15:21:47 -06:00
Garret Rieger
52bc78e70d
s/PairPos/MarkBasePos/ in MarkBasePos repacking implementation.
2023-10-16 12:25:25 -06:00
Qunxin Liu
1f395cbaf9
[instancer] templatize the priority queue, use custom type for varstore
...
when instantiating varstore, we need to pop a tuple like
(combined_gain, i, j), if combined gain is the same then we compare the
value of i, and then j. So we'd like to use custom type as the key when
popping from the queue. This would match fonttool's algorithm cause it
uses heappop().
2023-10-13 14:52:27 -06:00
Vincent Torri
17ee3cd7f4
fix warning with unsigned long
2023-09-10 11:34:30 +03:00
Garret Rieger
a1f034eaac
[repacker] fix fuzzer failure.
...
Fixes: https://oss-fuzz.com/testcase-detail/6490945267564544
2023-08-28 23:17:13 -04:00
Garret Rieger
c28fdc39b2
[repacker] fix bot failure.
2023-08-23 17:03:54 -06:00
Garret Rieger
5587247d5b
[repacker] create only one extension subtable per physical subtable.
...
During extension promotion when multiple lookups refer to a shared subtable node create and reuse a single extension subtable for it. Fixes: https://github.com/fonttools/fonttools/issues/3260 .
2023-08-23 17:03:54 -06:00
Garret Rieger
ca906e8747
[repacker] fix fuzzer timeout.
...
Corrects some mistakes in the handling of incoming_edges_ when memory allocation failures happen.
2023-08-17 12:01:44 -06:00
Behdad Esfahbod
91c449a64a
[graph] Make space_for non-recursive
...
It was tail-recursive so perhaps the compiler did the same.
Anyway, make it explicit now.
2023-08-02 14:40:55 -06:00
Behdad Esfahbod
70b3fbed28
[graph] Fix invalid read when map gets resized
...
I don't fully understand how the old code was wrong, since
*v should be evaluated before the set() method call.
Yet this seems to fix a bug that could be reproduced
with HB_DEBUG_SUBSET_REPACK enabled and the following:
$ hb-repacker-fuzzer test/fuzzing/graphs/clusterfuzz-testcase-minimized-hb-repacker-fuzzer-6419865171525632
2023-08-01 15:16:16 -06:00
Behdad Esfahbod
94d4283b12
[graph] Handle a malloc fail
...
Fixes https://oss-fuzz.com/testcase-detail/4579249263345664
2023-08-01 15:06:01 -06:00
Behdad Esfahbod
603920e911
[graph] Minor asserts
2023-08-01 14:58:33 -06:00
Behdad Esfahbod
8d00476fbf
[graph] Minor restructure a condition
2023-08-01 14:27:37 -06:00
Behdad Esfahbod
7946984b96
[graph] More assert
2023-08-01 14:18:03 -06:00
Behdad Esfahbod
3b386c3773
[graph] Minor assert
2023-08-01 14:15:41 -06:00
Behdad Esfahbod
07e7033076
[graph] Error check
2023-08-01 12:25:45 -06:00
Behdad Esfahbod
7a9aac1ae3
[graph] Fixes to parent handling
2023-08-01 12:17:13 -06:00
Behdad Esfahbod
23838e5a2e
[graph] Error handling
2023-07-29 13:20:14 -06:00
Behdad Esfahbod
04f4909257
[graph] Use a move instead of swap
2023-07-28 14:37:52 -06:00
Behdad Esfahbod
3bedb0eeed
[graph] Minor rename
2023-07-27 16:04:01 -06:00
Behdad Esfahbod
bb1f53c254
[graph] Try fixing infinite loop found by CIFuzz under malloc fail
2023-07-27 13:29:56 -06:00
Behdad Esfahbod
db3314c1f8
[graph] Minor space type change
2023-07-27 13:20:32 -06:00
Behdad Esfahbod
6bb61708ed
[graph] Try fixing bots
2023-07-27 13:06:30 -06:00
Behdad Esfahbod
1b5abb1781
[graph] Speed-up vertices having only one parent
2023-07-27 12:56:06 -06:00
Behdad Esfahbod
f3d0b11d57
[graph] Make parents private
2023-07-27 12:56:06 -06:00
Behdad Esfahbod
d3b997ee70
[graph] Use a hb_map_t to keep parents, instead of hb_vector_t
...
In some fonts, for example Noto Duployan-Regular, nodes can
have over a thousand parents... Speeds up 10% subsetting.
2023-07-27 12:55:57 -06:00
Behdad Esfahbod
326d319f93
[graph] Micro-optimize
2023-07-15 13:14:34 -06:00
Behdad Esfahbod
548230e45e
[graph] Early return from a function
2023-07-15 13:13:16 -06:00
Behdad Esfahbod
09706b04fc
[graph] Add a pre-alloc to map
2023-07-15 13:11:04 -06:00
Behdad Esfahbod
d1ddfc4d10
[graph] Use move instead of swap
2023-07-14 14:52:43 -06:00
Behdad Esfahbod
07cb6bf87a
[graph] Minor, type
2023-07-14 13:38:33 -06:00
Behdad Esfahbod
867640af31
Revert "[set] Add test_and_add / test_and_del"
...
This reverts commit de1237fbf2 .
This seems to be a net loss.
2023-07-14 13:09:16 -06:00
Behdad Esfahbod
10b776b0c3
[graph] Micro-optimize
2023-07-14 13:08:19 -06:00
Behdad Esfahbod
de1237fbf2
[set] Add test_and_add / test_and_del
...
Use in graph.
2023-07-14 12:38:56 -06:00
Behdad Esfahbod
7f1ff9c881
[graph] Micro-optimize array access
2023-07-14 12:22:24 -06:00
Behdad Esfahbod
11308c4d1f
[graph] Remove manual destruction
...
Happens automatically by destructor.
2023-06-08 14:51:18 -06:00
Behdad Esfahbod
67b1624727
[set] Simplify a few set iterations as range loop
2023-06-07 16:25:11 -06:00
Behdad Esfahbod
ada1e9a924
[graph/serialize] Handle empty blob
...
Fixes https://oss-fuzz.com/testcase-detail/4877513265119232
2023-06-06 14:46:47 -06:00
Behdad Esfahbod
ca27925d55
Use hb_codepoint_pair_t in more places
2023-06-03 16:18:15 -06:00