Commit Graph

37 Commits

Author SHA1 Message Date
Garret Rieger f2b9065246 [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.
2022-07-25 21:55:03 +00:00
Garret Rieger e4fd5ff727 [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
2022-07-25 21:31:17 +00:00
Garret Rieger ffb0f7936f [repacker] add ext promotion test. 2022-07-22 22:36:04 +00:00
Garret Rieger 6fad6b4113 [repacker] add tests for special casing of 24bit offsets. 2022-07-06 19:18:27 +00:00
Garret Rieger 7078560e33 [repacker] extract graph serialization code into a seperate file. 2022-06-24 17:16:50 -06:00
Garret Rieger 20b02a672d [repacker] Begin splitting up the repacker implementation into several files. 2022-06-24 17:16:50 -06:00
Garret Rieger b32ca2a292 [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.
2022-05-20 09:41:18 -06:00
Garret Rieger 441877f56a [repacker] add test case for using max priority to resolve an overflow. 2021-12-09 17:46:52 -07:00
Garret Rieger fa966bcc29 [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.
2021-12-06 21:27:28 -07:00
Garret Rieger 9121ed0cec [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.
2021-12-01 08:37:04 -07:00
Garret Rieger 5bfc7d1015 [repacker] remove VirtualOffset struct.
Make and add_virtual_link () specialization of add_link() instead.
2021-11-02 12:19:13 -06:00
Garret Rieger bc4c5341d6 [repacker] Add test for virtual links in the repacker. 2021-11-02 12:19:13 -06:00
Garret Rieger 7f0ede4f04 [repacker] refactor resolve overflow tests to use a helper. 2021-10-05 13:10:01 -07:00
Garret Rieger 7883b7ed95 [repacker] Add additional splitting spaces test.
Fix issues it uncovered.
2021-10-05 12:46:59 -07:00
Garret Rieger 6265663de4 [repacker] add test for splitting spaces. 2021-10-05 11:30:04 -07:00
Garret Rieger 0dccbf368f [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.
2021-09-29 14:28:27 -07:00
Garret Rieger 816c5302a7 [repacker] restrict 32 bit subgraph connected component search to only nodes reachable via directed links. 2021-09-28 16:04:27 -07:00
Garret Rieger 67eb222b8e [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).
2021-09-28 13:54:54 -07:00
Garret Rieger 307acf7fb0 [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.
2021-09-28 12:08:18 -07:00
Garret Rieger efda2f14e1 [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.
2021-09-24 17:53:08 -06:00
Garret Rieger 9247d24d7f [repacker] s/0/HB_TAG_NONE 2021-09-22 18:18:50 -06:00
Garret Rieger d0daa7a59b [repacker] add a couple more complex isolation tests. 2021-09-22 18:18:50 -06:00
Garret Rieger 58facaade1 [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.
2021-09-22 18:18:50 -06:00
Garret Rieger 543a3f9733 [repacker] Add repacker test for subgraph isolation. 2021-09-22 18:18:50 -06:00
Garret Rieger 41bbf2812e [repacker] do extension subtable isolation before starting resolution attempts. 2021-09-22 18:18:50 -06:00
Behdad Esfahbod bb48bf52a4 Rename misc uses of "free"
In preparation for fixing https://github.com/harfbuzz/harfbuzz/issues/3044
2021-07-08 10:54:09 -07:00
Garret Rieger 73ed59f7a6 [subset] store errors in the serializer as a flag set.
Make check_assign/check_equal specify the type of error to set.
2021-03-17 15:58:34 -07:00
Garret Rieger e2f14e81bd [subset] fix memory leaks in test-repacker. 2021-03-17 15:53:58 -07:00
Garret Rieger a7a86a6eb4 [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.
2021-03-17 15:53:58 -07:00
Garret Rieger b452b2c76c [subset] refactor repacker graph to cache edge count and distances of vertices. 2021-03-17 15:53:57 -07:00
Garret Rieger 75414e82b5 [subset] Add table duplication overflow resolution. 2021-03-17 15:53:57 -07:00
Garret Rieger 4c8dd41ed9 [subset] re-write compute distances to use an array lookup for the distance map. 2021-03-17 15:53:57 -07:00
Garret Rieger aaa7873d42 [subset] add topological sort by closest distance via Dijkstra's algorithm. 2021-03-17 15:53:57 -07:00
Garret Rieger 8ebe5d734f Implement will_overflow (). 2021-03-17 15:53:57 -07:00
Garret Rieger f4c78cc7dd [subset] Implement Kahn's algo for topological sorting instead of BFS. 2021-03-17 15:53:57 -07:00
Garret Rieger 00f393dc3f [subset] finish up BFS sort implementation. 2021-03-17 15:53:57 -07:00
Garret Rieger 1584d3cb8f [subset] Start a proof of concept implementation of the GSUB/GPOS offset overflow resolver. 2021-03-17 15:53:57 -07:00