src/graph


Log

Author Commit Date CI Message
Ebrahim Byagowi 677d6646 2024-07-08T15:33:39 [subset] Make sure the clamp is done in a int64_t space Otherwise nags about things like this, In member function ‘int64_t graph::graph_t::vertex_t::modified_distance(unsigned int) const’, inlined from ‘void graph::graph_t::sort_shortest_distance()’ at ../src/graph/graph.hh:626:24: ../src/graph/graph.hh:371:20: warning: dangling pointer to an unnamed temporary may be used [-Wdangling-pointer=] 371 | hb_clamp (distance + distance_modifier (), (uint64_t) 0, (uint64_t) 0x7FFFFFFFFFF); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ And some of the CI bots fail also like this https://github.com/harfbuzz/harfbuzz/actions/runs/9838686960/job/27159310858?pr=4793 But it probably something else also can be improved which maybe is out of scope for this particular change.
Ebrahim Byagowi 495937f9 2024-07-08T14:46:48 [subset] Use hb_clamp instead of consequent hb_min and hb_max calls As just a minor code tweak to clarify the intention better.
Garret Rieger 79eaa217 2024-03-14T21:22:22 [repacker] remove unused include.
Garret Rieger 025f5276 2024-03-09T00:32:36 [repacker] fix mem leak in test-classdef-graph test.
Garret Rieger 8e1beefe 2024-03-08T22:05:20 [repacker] small fixes.
Garret Rieger 17b37f10 2024-03-08T22:01:05 [repacker] add classdef size est. test that you can add the same class multiple times.
Garret Rieger 0ac9e7da 2024-03-08T21:53:10 [repacker] in classdef estimator tests compare results to actual class def serialization. Fix the estimator to actually match real serialization sizes.
Garret Rieger 8129b21d 2024-03-08T20:15:43 Update classdef size estimator to pick the min coverage format. Previously this just assumed a worst case format 1.
Garret Rieger 252a926f 2024-03-08T19:46:48 [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).
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 6f64fa75 2023-12-05T19:45:16 [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.
Behdad Esfahbod 330c32f9 2023-11-10T12:27:48 [graph] Another preallocation
Behdad Esfahbod 9c4d3c3c 2023-11-10T12:24:26 [graph] Pre-alloc priority-heap array
Behdad Esfahbod 3a9262cc 2023-11-04T12:52:46 [sanitize] More hb_barrier() annotations
Garret Rieger 52bc78e7 2023-10-10T21:44:52 s/PairPos/MarkBasePos/ in MarkBasePos repacking implementation.
Qunxin Liu 1f395cba 2023-10-12T10:06:00 [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().
Vincent Torri 17ee3cd7 2023-09-10T07:29:08 fix warning with unsigned long
Garret Rieger a1f034ea 2023-08-28T21:10:16 [repacker] fix fuzzer failure. Fixes: https://oss-fuzz.com/testcase-detail/6490945267564544
Garret Rieger c28fdc39 2023-08-23T22:16:39 [repacker] fix bot failure.
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 ca906e87 2023-08-16T23:37:03 [repacker] fix fuzzer timeout. Corrects some mistakes in the handling of incoming_edges_ when memory allocation failures happen.
Behdad Esfahbod 91c449a6 2023-08-02T14:40:55 [graph] Make space_for non-recursive It was tail-recursive so perhaps the compiler did the same. Anyway, make it explicit now.
Behdad Esfahbod 70b3fbed 2023-08-01T15:16:16 [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
Behdad Esfahbod 94d4283b 2023-08-01T15:05:17 [graph] Handle a malloc fail Fixes https://oss-fuzz.com/testcase-detail/4579249263345664
Behdad Esfahbod 603920e9 2023-08-01T14:58:33 [graph] Minor asserts
Behdad Esfahbod 8d00476f 2023-08-01T14:27:37 [graph] Minor restructure a condition
Behdad Esfahbod 7946984b 2023-08-01T14:18:03 [graph] More assert
Behdad Esfahbod 3b386c37 2023-08-01T14:12:43 [graph] Minor assert
Behdad Esfahbod 07e70330 2023-08-01T12:25:45 [graph] Error check
Behdad Esfahbod 7a9aac1a 2023-08-01T12:05:22 [graph] Fixes to parent handling
Behdad Esfahbod 23838e5a 2023-07-29T13:20:14 [graph] Error handling
Behdad Esfahbod 04f49092 2023-07-28T14:37:52 [graph] Use a move instead of swap
Behdad Esfahbod 3bedb0ee 2023-07-27T16:04:01 [graph] Minor rename
Behdad Esfahbod bb1f53c2 2023-07-27T13:29:56 [graph] Try fixing infinite loop found by CIFuzz under malloc fail
Behdad Esfahbod db3314c1 2023-07-27T13:20:32 [graph] Minor space type change
Behdad Esfahbod 6bb61708 2023-07-27T13:02:55 [graph] Try fixing bots
Behdad Esfahbod 1b5abb17 2023-07-27T12:41:43 [graph] Speed-up vertices having only one parent
Behdad Esfahbod f3d0b11d 2023-07-27T12:20:39 [graph] Make parents private
Behdad Esfahbod d3b997ee 2023-07-26T15:39:14 [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.
Behdad Esfahbod 326d319f 2023-07-15T13:14:34 [graph] Micro-optimize
Behdad Esfahbod 548230e4 2023-07-15T13:13:16 [graph] Early return from a function
Behdad Esfahbod 09706b04 2023-07-15T13:11:04 [graph] Add a pre-alloc to map
Behdad Esfahbod d1ddfc4d 2023-07-14T14:52:43 [graph] Use move instead of swap
Behdad Esfahbod 07cb6bf8 2023-07-14T13:38:33 [graph] Minor, type
Behdad Esfahbod 867640af 2023-07-14T13:09:16 Revert "[set] Add test_and_add / test_and_del" This reverts commit de1237fbf2660b5952dde4db171a62d9b1a77c92. This seems to be a net loss.
Behdad Esfahbod 10b776b0 2023-07-14T13:08:19 [graph] Micro-optimize
Behdad Esfahbod de1237fb 2023-07-14T12:38:56 [set] Add test_and_add / test_and_del Use in graph.
Behdad Esfahbod 7f1ff9c8 2023-07-14T12:22:24 [graph] Micro-optimize array access
Behdad Esfahbod 11308c4d 2023-06-08T14:51:18 [graph] Remove manual destruction Happens automatically by destructor.
Behdad Esfahbod 67b16247 2023-06-07T16:15:48 [set] Simplify a few set iterations as range loop
Behdad Esfahbod ada1e9a9 2023-06-06T14:46:06 [graph/serialize] Handle empty blob Fixes https://oss-fuzz.com/testcase-detail/4877513265119232
Behdad Esfahbod ca27925d 2023-06-03T16:18:15 Use hb_codepoint_pair_t in more places
Garret Rieger ff326fbe 2023-05-29T21:31:01 [repacker] check the result of add_buffer() in other places where it's called.
Garret Rieger 20c564bc 2023-05-26T23:04:25 [repacker] Fix fuzzer memory leak. https://oss-fuzz.com/testcase-detail/6419865171525632
Behdad Esfahbod 3c2a925b 2023-05-08T09:43:01 [graph] Micro-optimize
Behdad Esfahbod 3f9eb03b 2023-05-01T12:49:40 [graph] Micro-optimize
Garret Rieger b3fed4fa 2023-04-27T22:13:30 [repacker] fix fuzzer found memory leak. Fixes https://oss-fuzz.com/testcase-detail/5196242811748352
Garret Rieger e4fff64c 2023-01-24T00:52:26 [repacker] check duplicate() for success. Fixes fuzzer testcase https://oss-fuzz.com/testcase-detail/5475787333828608.
Behdad Esfahbod ed023f66 2023-01-12T17:04:24 Enable -Wformat-signedness And fix the codebase.
Garret Rieger 35233d25 2022-12-07T00:47:28 [repacker] fix fuzzer reported stack overflow. Fixes https://oss-fuzz.com/testcase-detail/6014493291577344.
Garret Rieger f1d34893 2022-12-05T19:33:15 [repacker] bail on failure to alloc assigned_bytes set. Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/5390364397928448.
Garret Rieger 239a5aca 2022-12-05T19:15:36 [repacker] don't allow references to the null object in graph. Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6714085985353728
Behdad Esfahbod 2cdaedaf 2022-12-03T10:16:35 Use hb_enumerate in more places
Garret Rieger de5a6213 2022-12-01T23:37:16 [repacker] enforce root node having no incoming edges.
Garret Rieger 30e405e4 2022-12-01T22:12:59 [repacker] ensure link obj indices are valid.
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.
Garret Rieger 9e99d084 2022-09-08T23:19:02 [repacker] validate link widths during repacker setup.
Garret Rieger edf7a295 2022-09-08T22:59:34 [repacker] Validate link positions before running the repacker.
Garret Rieger deca30b2 2022-09-08T21:10:06 [repacker] get repacker fuzzer working. Additionally add helper method that allows a graph to be saved as a fuzzer seed.
Garret Rieger 985b19f6 2022-09-07T22:21:16 [repacker] begin implementing a fuzzer for the repacker api.
Behdad Esfahbod 915c1a00 2022-11-26T14:48:57 [vector] Add remove_unordered Saves 5% in NotoNastaliq/1000 subset benchmark.
Behdad Esfahbod 4afcdf67 2022-11-22T12:56:48 More hb_memcpy
Garret Rieger dd1ba328 2022-11-21T23:20:59 [repacker] fix fuzzer timeout. For https://oss-fuzz.com/testcase-detail/5845846876356608. Only process the set of unique overflows.
Behdad Esfahbod 02b76393 2022-10-29T11:15:03 [config] Re-enable BORING_EXPANSION Only the non-experimental parts (currently avar2) are enabled by default.
Joel Auterson c813f842 2022-10-20T19:45:23 Make build work for arm-none-eabi
Garret Rieger 9559d3c1 2022-10-11T19:49:01 [repacker] fix incorrect coverage table size estimation. During splitting of PairPosFormat2 the code was assuming the maximum size of the generated coverage table would be equal too the current size. This is incorrect size the new coverage table may not preserve the ranges found in the original coverage table (since we are splitting based on class, not coverage) and in the worst case may convert from format2 to format1. So use the size of a format1 table as the max size.
Garret Rieger 99f4668e 2022-09-29T19:39:59 [repacker] use mutable copies of Coverage/ClassDef in MarkBasePos shrink operation. Also make mutable copies (when needed) of the top level subtables during a split operation.
Behdad Esfahbod 56c46709 2022-09-20T17:39:54 [subset] Fix compiler warning Fixes https://github.com/harfbuzz/harfbuzz/issues/3823
Garret Rieger a91bfeed 2022-08-18T22:01:48 [repacker] comment cleanup.
Garret Rieger bf28b84a 2022-08-18T01:51:37 [repacker] cleanup unused base_array_id.
Garret Rieger 31976bfb 2022-08-18T01:50:35 [repacker] cleanup unused base_array_links.
Garret Rieger 6f5c52b6 2022-08-18T01:48:10 [repacker] optimize AnchorMatrix::clone. Previous runtime is O(n^2) reduced to O(n).
Garret Rieger 29e3b246 2022-08-18T01:19:54 [repacker] optimzie remove_real_links as it's a hot method.
Garret Rieger 46b5dbd7 2022-08-18T01:18:16 [repacker] optimize index_for_offset.
Garret Rieger 52303638 2022-08-18T01:10:42 [repacker] correct size calculation for MarkBasePosFormat1.
Garret Rieger ac1a853a 2022-08-18T00:55:47 [repacker] implement sanitize methods for MarkBasePos.
Garret Rieger a3ed9f90 2022-08-17T23:39:11 [repacker] fix graph comparison, and mark base pos generation for the tests.
Garret Rieger b46ced95 2022-08-17T17:51:02 [repacker] correct MarkArray size calculation.
Garret Rieger 36c76c27 2022-08-17T17:30:21 [repacker] when clearing links in MarkArray, also clear parents of the children.
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 07fd0528 2022-08-15T23:16:51 [repacker] add graph equality check. Does not compare topological sorting, but looks for equivalence of the two graphs.
Garret Rieger 5cf2a25a 2022-08-15T22:49:24 [repacker] Expose on internal method in the repacker that allows the caller to pass in/out a graph. Will be used in testing so we can compare graphs instead of packed result.
Garret Rieger c414ef29 2022-08-15T22:10:37 [repacker] Implement MarkArray::shrink.
Garret Rieger f8b55205 2022-08-11T23:09:36 [repacker] Add AnchorMatrix::shrink.
Garret Rieger bbe14417 2022-08-11T22:53:30 [repacker] Begin implementing MarkBasePosFormat1::shrink.
Garret Rieger c9ddf081 2022-08-11T22:34:59 [repacker] Implement AnchorMatrix::clone.
Garret Rieger 5ea3c0be 2022-08-11T22:21:28 [repacker] Implement MarkArray::clone.
Garret Rieger 0083fd10 2022-08-11T22:09:46 [repacker] add as_table() helper to graph.
Garret Rieger b00eb776 2022-08-11T20:33:21 [repack] Add add_link helper to graph.