Update depend API docs and add explicit test mode to fuzzer

Documentation updates:
- Add comprehensive context_set documentation to depend-api.md with
  encoding details and example code for check_context_satisfied()
- Update depend-for-closure.md: remove obsolete over-approximation
  analysis, reflect that recent testing shows no over-approximation
  with proper context_set filtering
- Update depend-implementation.md: correct descriptions of active
  glyph filtering, sequential accumulation, ligature sets, and
  context recording to match current implementation
- Fix terminology: change 'binning' to 'segmentation' throughout
- Fix hb-depend-data.hh:557: use HB_CODEPOINT_INVALID instead of 0
  for layout_tag default value

Fuzzer enhancements (hb-depend-closure-parity):
- Add explicit test mode with command-line options similar to
  hb-subset conventions:
    --unicodes=LIST       Unicode codepoints (U+XXXX, decimal, ranges)
    --gids=LIST           Glyph IDs (decimal, ranges)
    --no-layout-closure   Skip GSUB closure
    --layout-features=LIST GSUB features (comma-separated or *)
- Support multiple input formats:
    --unicodes=U+0041,U+0042,U+0043
    --unicodes=65-90
    --gids=10-50 --no-layout-closure
    --layout-features=liga,calt or --layout-features='*'
- Add robust input parsing with validation to prevent infinite loops
  on invalid input (e.g., --gids=abc or --unicodes=U+GGGG)
- Add error checking for conflicting options

This allows reproducing random test cases manually and testing
specific scenarios without finding the right seed.

Tested: All modes produce identical results to seed-based tests.
This commit is contained in:
Skef Iterum committed 2026-02-05 19:11:40 -08:00
1 parent 0d98125820
commit 9101d242b3
13 files changed
+1719 -826

No files matched your search

+9 -2
View File
@@ -245,6 +245,7 @@ find_dependency (hb_depend_t *depend,
hb_codepoint_t dependent;
hb_tag_t layout_tag;
hb_codepoint_t ligature_set;
hb_codepoint_t context_set;
hb_tag_t filter_layout_tag = (out_layout_tag && *out_layout_tag != HB_TAG_NONE)
? *out_layout_tag : HB_TAG_NONE;
@@ -252,7 +253,7 @@ find_dependency (hb_depend_t *depend,
{
hb_bool_t found = hb_depend_get_glyph_entry (depend, source_glyph, index,
&table_tag, &dependent,
&layout_tag, &ligature_set);
&layout_tag, &ligature_set, &context_set);
if (!found)
break;
@@ -549,7 +550,13 @@ test_depend_gsub_formats (void)
g_assert_true (find_dependency (depend_notosans, 3948, 4017, HB_OT_TAG_GSUB,
&layout_tag, &ligature_set));
g_test_message (" ligature_set = %u", ligature_set);
g_assert_cmpuint (684, ==, ligature_set);
/* Verify ligature set contains the other component glyph (3969) */
g_assert_cmpuint (HB_CODEPOINT_INVALID, !=, ligature_set);
hb_set_t *lig_set = hb_set_create ();
g_assert_true (hb_depend_get_set_from_index (depend_notosans, ligature_set, lig_set));
g_assert_true (hb_set_has (lig_set, 3969)); /* uni0944 is the other ligature component */
hb_set_destroy (lig_set);
hb_depend_destroy (depend_notosans);
hb_face_destroy (face_notosans);