src/test-repacker.cc

Branch


Log

Author Commit Date CI Message
Garret Rieger 54ab8f0d 2025-09-15T18:20:59 [repacker] make repacker object ids stable. Prior to this change the object id for a vertex in the repacker graph is it's position in the topological ordering. As a result after each sorting the object ids change. This decouples the topological sorting from the object id assignments. A separate ordering list is retained. This simplifies handling around object ids which no longer needs to account for them shifting, and improves performance by eliminating the step of reassigned link object ids after each sort.
Behdad Esfahbod 75f91987 2025-07-25T02:39:47 [src/test-*] Use hb_always_assert() which isn't compiled out under NDEBUG Part of https://github.com/harfbuzz/harfbuzz/issues/5418
Garret Rieger e50d16f6 2025-07-09T23:48:45 [repacker] During liga splitting re-use orphaned liga sets.
Garret Rieger cad41886 2025-07-09T17:09:05 [repacker] fix bug where nodes with incoming virtual links could get orphaned. When attempting to fix overflows nodes that have incoming edges from more than one parent can be duplicated. However, if all of these incoming links are virtual except for one duplicating it will effectively orphan it (one of the copies will be pointed to only by virtual links). Since parent book keeping is expensive we don't want to separately track virtual/real parents so instead just don't duplicate nodes that have at least one incoming virtual link.
Garret Rieger f5279200 2025-07-08T22:46:33 [repacker] Add test which hits the move liga set pathway in clone_range().
Garret Rieger 96fedd88 2025-07-08T01:14:14 [repacker] Fix handling of virtual links in liga table splitting.
Garret Rieger 5b47710f 2025-07-07T20:15:30 [repacker] Start implementing test for liga splitting.
Garret Rieger 69f9c29e 2024-03-29T00:19:16 [repacker] add tests of serializer repack_last().
Garret Rieger 01fc4a16 2024-03-09T00:06:37 [repacker] Fix repacker test. With class def size estimation changes this test is now able to pack closer to the limit.
Garret Rieger 7160c5b9 2023-12-05T20:58:00 [repacker] add tests for multi-duplication. Further improve the resolution attempt by pre-emptively raising priority of a duplicated shared node.
Garret Rieger 5587247d 2023-08-23T21:54:15 [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.
Garret Rieger 554ed06f 2022-12-01T21:51:17 [repacker] add cycle detection to the graph sort. This allows us to bail early if the graph is not acyclic.
Behdad Esfahbod 59c45f6d 2022-11-22T12:54:50 Use hb_memcpy instead of memcpy consistently
Garret Rieger 015ca5bc 2022-08-18T21:52:55 [repacker] fix compiler alignment warning.
Garret Rieger 683c5dd2 2022-08-18T20:57:04 [repacker] further reduce base count.
Garret Rieger 5ddf41fc 2022-08-18T20:28:05 [repacker] speed up MarkBasePos test case by using a smaller basecount.
Garret Rieger a3ed9f90 2022-08-17T23:39:11 [repacker] fix graph comparison, and mark base pos generation for the tests.
Garret Rieger 19c51ed3 2022-08-17T19:15:55 [repacker] Get mark base pos test working.
Garret Rieger 8c3db8bd 2022-08-17T00:36:23 [repacker] more progress on MarkBasePos tests.
Garret Rieger 1405f96b 2022-08-15T23:48:00 [repacker] change run_resolve_overflow_test to check for graph equivalence. Replaces a check for an exact match on the final serialized bytes. The previous check enforced equivalent topological sorting between result and expected, but we only really care that the graph's are equivalent and don't overflow.
Garret Rieger 0e48a65d 2022-08-05T20:19:11 [repacker] estimate size of classDef1 and coverage during PairPos2 split point analysis.
Garret Rieger e1ab3550 2022-08-05T01:25:16 [repacker] correct lookup link insertion.
Garret Rieger a733a9af 2022-08-05T00:32:47 [repacker] insert new subtables immediately after the subtable they split from in the lookup.
Garret Rieger fdd1952c 2022-08-04T19:21:16 [repacker] PairPosFormat2 splitting - fix coverage and classdef splitting. The old code was splitting based on coverage index, but should have been splitting on class value.
Garret Rieger 51a50602 2022-08-03T22:30:42 [repacker] add test for splitting a PairPos2 w/ device tables.
Garret Rieger 54fab21c 2022-08-03T21:57:37 [repacker] get basic pair pos 2 split test working.
Garret Rieger 60d6ffb3 2022-08-03T21:01:23 [repacker] always duplicate classDef2 when splitting a PairPos2. Splits are done in a way that it shouldn't be possible to share the classDef2 between split PairPos2's so pre-emptively duplicate it.
Garret Rieger 6be15242 2022-08-03T19:02:20 [repacker] add basic test for PairPos2 splitting.
psykose 04d28d94 2022-08-01T07:45:25 [repacker] fix signedness of char in tests
Garret Rieger 674f0194 2022-07-29T17:59:50 [repacker] add extension pairpos split test.
Garret Rieger 1d2516f0 2022-07-29T17:57:18 [repack] get basic pairpos split test working.
Garret Rieger 4e7360f7 2022-07-28T22:56:47 [repacker] begin adding tests for PairPosFormat1 splitting.
Garret Rieger f56e66f3 2022-07-25T21:55:03 [repacker] for ext promotion choose lookups from highest subtables per byte to lowest. Attempts to roughly maximize the number of subtables that are non-ext.
Garret Rieger 9d0b2da5 2022-07-25T20:46:49 [repacker] count subtable size in each group of consecutive layers for extension promotion decisions. Enforce that the following groups are all <64k in size: - LookupList + Lookups - Lookups + SubTables - SubTables + Descendants
Garret Rieger 7de136f8 2022-07-22T21:04:34 [repacker] add ext promotion test.
Garret Rieger 6fad6b41 2022-07-06T19:18:27 [repacker] add tests for special casing of 24bit offsets.
Garret Rieger 7078560e 2022-06-24T19:20:20 [repacker] extract graph serialization code into a seperate file.
Garret Rieger 20b02a67 2022-06-24T18:58:17 [repacker] Begin splitting up the repacker implementation into several files.
Garret Rieger b32ca2a2 2022-05-19T20:45:39 [subset-perf] remove sort_kahn from repacker. Without an optimized FIFO queue implementation it's nearly as slow as the now optimized sort_shortest_distance.
Garret Rieger 441877f5 2021-12-09T16:38:05 [repacker] add test case for using max priority to resolve an overflow.
Garret Rieger fa966bcc 2021-12-06T12:54:19 [repacker] create repacker output buffer after final length is known. Don't rely on a buffer provided by the caller, as it may not be large enough.
Garret Rieger 9121ed0c 2021-11-30T13:45:22 [subset] Improve sharing of Ligature subtables. Ligature subtables use virtual links to enforce an ordering constraint between the subtables and the coverage table. Unfortunately this has the sideeffect of prevent the subtables from being shared by another Ligature with a different coverage table since object equality compares all links real and virtual. This change makes virtual links stored separately from real links and updates the equality check to only check real links. If an object is de-duped any virtual links it has are merged into the object that replaces it.
Garret Rieger 5bfc7d10 2021-09-23T14:45:20 [repacker] remove VirtualOffset struct. Make and add_virtual_link () specialization of add_link() instead.
Garret Rieger bc4c5341 2021-09-23T14:41:42 [repacker] Add test for virtual links in the repacker.
Garret Rieger 7f0ede4f 2021-10-05T13:10:01 [repacker] refactor resolve overflow tests to use a helper.
Garret Rieger 7883b7ed 2021-10-05T12:46:59 [repacker] Add additional splitting spaces test. Fix issues it uncovered.
Garret Rieger 6265663d 2021-10-05T11:30:04 [repacker] add test for splitting spaces.
Garret Rieger 0dccbf36 2021-09-29T14:28:27 [repacker] Handle the case where a subgraph root has an incoming 32 and 16 bit edge. In this case the entire subgraph from that root will be duplicated.
Garret Rieger 816c5302 2021-09-28T16:04:27 [repacker] restrict 32 bit subgraph connected component search to only nodes reachable via directed links.
Garret Rieger 67eb222b 2021-09-28T13:36:06 [repacker] when assigning each connected subgraph a space, also isolate it. This will break any links coming from space 0 (ie. the 16 bit offset only space).
Garret Rieger 307acf7f 2021-09-28T12:08:18 [repacker] add space assignment based on connected components. Assign each connected component that is underneath one or more 32 bit offsets into a unique space. This ensures that 32 bit subgraphs which are connected are packed into the same space.
Garret Rieger efda2f14 2021-09-24T16:28:34 [repacker] fix bug in subgraph isolation. Prior to this fix id remapping at the end of the isolation operation was fed the old subgraph instead of the new one. Which results in object indices being remapped for the nodes outside of the new subgraph. Adds a test which detects this problem.
Garret Rieger 9247d24d 2021-09-22T16:00:02 [repacker] s/0/HB_TAG_NONE
Garret Rieger d0daa7a5 2021-09-09T10:25:43 [repacker] add a couple more complex isolation tests.
Garret Rieger 58facaad 2021-09-08T16:08:48 [repacker] put each 32 bit subgraph into it's own packing space. Each subgraph pointed to by a 32 bit offset should be packed into it's own space. This adds a space property to vertices which affects the distance calculation. This effectively places the distances for all of the nodes of a 32 bit subgraph into a distinct range. Thus all of the nodes of the subgraph will be packed together.
Garret Rieger 543a3f97 2021-09-08T15:07:02 [repacker] Add repacker test for subgraph isolation.
Garret Rieger 41bbf281 2021-09-08T10:14:00 [repacker] do extension subtable isolation before starting resolution attempts.
Behdad Esfahbod bb48bf52 2021-07-08T10:53:45 Rename misc uses of "free" In preparation for fixing https://github.com/harfbuzz/harfbuzz/issues/3044
Garret Rieger 73ed59f7 2021-03-17T15:53:10 [subset] store errors in the serializer as a flag set. Make check_assign/check_equal specify the type of error to set.
Garret Rieger e2f14e81 2020-11-11T13:55:35 [subset] fix memory leaks in test-repacker.
Garret Rieger a7a86a6e 2020-11-06T16:22:48 [subset] Add prioritization offset resolution. Vertices can now be prioritized to force them to sort closer to their parent. The resolver will attempt to use this for overflows on non-shared vertices.
Garret Rieger b452b2c7 2020-11-06T15:37:05 [subset] refactor repacker graph to cache edge count and distances of vertices.
Garret Rieger 75414e82 2020-11-05T16:39:23 [subset] Add table duplication overflow resolution.
Garret Rieger 4c8dd41e 2020-11-05T09:21:25 [subset] re-write compute distances to use an array lookup for the distance map.
Garret Rieger aaa7873d 2020-11-02T16:16:27 [subset] add topological sort by closest distance via Dijkstra's algorithm.
Garret Rieger 8ebe5d73 2020-11-02T14:51:39 Implement will_overflow ().
Garret Rieger f4c78cc7 2020-10-30T10:29:51 [subset] Implement Kahn's algo for topological sorting instead of BFS.
Garret Rieger 00f393dc 2020-10-29T14:58:34 [subset] finish up BFS sort implementation.
Garret Rieger 1584d3cb 2020-10-28T17:49:09 [subset] Start a proof of concept implementation of the GSUB/GPOS offset overflow resolver.