From e24eae7e3bb40394519d3c3cda1eb784dc02c0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20M=2E=20Wo=C5=BAniak?= Date: Wed, 4 Nov 2026 09:14:12 +0100 Subject: [PATCH] feat(verify): cover BrushDescriptor in verify-brushkit and fix map drift --- .claude/skills/verify-brushkit/SKILL.md | 4 +- .../skills/verify-brushkit/features/README.md | 2 + .../features/brush-descriptor.md | 46 +++++++++++++++++++ .../verify-brushkit/features/parse-abr.md | 10 ++-- .../verify-brushkit/features/preview.md | 15 +++--- .../skills/verify-brushkit/features/stop.md | 2 +- .../skills/verify-brushkit/probe/src/main.rs | 4 ++ 7 files changed, 68 insertions(+), 15 deletions(-) create mode 100644 .claude/skills/verify-brushkit/features/brush-descriptor.md diff --git a/.claude/skills/verify-brushkit/SKILL.md b/.claude/skills/verify-brushkit/SKILL.md index 6e0bcb9..d999b3b 100644 --- a/.claude/skills/verify-brushkit/SKILL.md +++ b/.claude/skills/verify-brushkit/SKILL.md @@ -1,6 +1,6 @@ --- name: verify-brushkit -description: Drive the brushkit library the way a downstream Rust consumer does and capture proof. Builds a probe crate that calls the public `brushkit` facade (parse_abr*, preview_abr/brush/brushset, *_first_available, preview with keep_going, contact sheets, procreate::Zip, descriptor dump) on real or synthetic brush files and writes JSON summaries and PNGs. Use to prove a reader or renderer change works on real files, beyond `cargo test`. +description: Drive the brushkit library the way a downstream Rust consumer does and capture proof. Builds a probe crate that calls the public `brushkit` facade (parse_abr*, preview_abr/brush/brushset, *_first_available, preview with keep_going, contact sheets, procreate::Zip, typed brush descriptors, descriptor dump) on real or synthetic brush files and writes JSON summaries and PNGs. Use to prove a reader or renderer change works on real files, beyond `cargo test`. --- # verify-brushkit @@ -60,7 +60,7 @@ The helper appends `--out ` itself. Commands: | Command | Public API called | Flags | |---|---|---| -| `parse` | `abr::parse_abr` or a deferred variant, then `DeferredPack::decode_tip` per brush and `up_front_decoded_len`, and `preview::synthesized_tip_side` per computed preset | `--mode eager\|deferred\|deferred-no-patterns\|all-deferred` (default `eager`) | +| `parse` | `abr::parse_abr` or a deferred variant, then `DeferredPack::decode_tip` per brush and `up_front_decoded_len`, and `preview::synthesized_tip_side` per computed preset. Each brush and computed preset carries its `BrushDescriptor` as `Debug` text | `--mode eager\|deferred\|deferred-no-patterns\|all-deferred` (default `eager`) | | `preview` | `preview::preview_abr`, `preview_brush` or `preview_brushset`, or the `_first_available` twin with `--first`, or `preview::preview` with a counting `keep_going` with `--stop-after`, then `generate_preview_png` per tip and `generate_contact_sheet_png` | `--kind abr\|brush\|brushset` (default from the file extension, required for extensionless fuzz seeds), `--max-cell N` (default 128), `--first N`, `--stop-after N` | | `zip` | `preview::procreate::Zip::open`, `names`, `members_in_zip_order`, `conflicting_names`, and with `--read` `read_entry` or `read_entry_within` | `--read NAME`, `--limit N` | | `dump` | `abr::parse_abr`, then `abr::dump::dump_descriptors` on `raw_desc_block`, serialized by serde | none | diff --git a/.claude/skills/verify-brushkit/features/README.md b/.claude/skills/verify-brushkit/features/README.md index 28ac23e..4510fd7 100644 --- a/.claude/skills/verify-brushkit/features/README.md +++ b/.claude/skills/verify-brushkit/features/README.md @@ -62,5 +62,7 @@ consumer-visible behavior, then exactly four H2 sections in this order: - [Parse an .abr pack](./parse-abr.md) covers the four `parse_abr*` entry points, unavailable brushes, uuids, up-front decoding, patterns, diagnostics and malformed input. +- [Brush descriptor](./brush-descriptor.md) covers the typed + `BrushDescriptor` of each sampled brush and computed preset. - [Descriptor dump](./descriptor-dump.md) covers `dump::dump_descriptors` with the `serde` feature. diff --git a/.claude/skills/verify-brushkit/features/brush-descriptor.md b/.claude/skills/verify-brushkit/features/brush-descriptor.md new file mode 100644 index 0000000..e6b7d6b --- /dev/null +++ b/.claude/skills/verify-brushkit/features/brush-descriptor.md @@ -0,0 +1,46 @@ +# Brush descriptor + +A consumer reads the Photoshop settings of each `.abr` preset as a typed +`BrushDescriptor`: spacing, diameter, computed geometry, the Shape Dynamics, +Scatter, Texture, Dual Brush, Transfer and Color Dynamics panels, the tool +settings saved with the preset and the tip's Intr flag. A readable sampled +brush and a computed preset each carry one. A field is `None` when the file +carries no value for it. + +## Sub-features + +- `desc-sampled` gives each readable sampled brush the descriptor of its preset in `AbrBrush::descriptor`. +- `desc-computed` gives each computed preset its descriptor in `ComputedPreset::descriptor`, with `computed` always `Some`. +- `desc-default` gives `BrushDescriptor::default()` to a brush with no preset: a v1/v2 pack, a pack without a `desc` block, or an unpaired record on the fallback path. +- `desc-gating` leaves a panel's fields `None` when the panel's `use*` flag (`useTipDynamics`, `useScatter`, `usePaintDynamics`, `useTexture`, `useColorDynamics`, `useDualBrush`) is false. +- `desc-tool-options` reads `toolOptions` into `ToolOptions`, with opacity and blend mode from `MdSl` when the top level lacks them. +- `desc-modes` gives the same descriptors in all four parse modes. + +## How to get to it (user POV) + +- `brushkit::abr::parse_abr(&bytes)?.brushes[i].descriptor` and `.computed_presets[i].descriptor`, or the same fields of `DeferredPack::pack`. +- `brushkit::abr::BrushDescriptor`, `ToolOptions`, `DualBrush` and `ComputedGeometry`. They derive `Debug`, `Clone`, `Default` and `PartialEq`, not serde. +- An unavailable brush (`UnavailableBrush`) and an unsupported preset (`UnsupportedTipPresetDetail`) carry no descriptor. + +## Driving it with verify-brushkit + +Preconditions: + +- Baseline preconditions from the index hold. +- The probe's `parse` command writes each descriptor as its `Debug` text in `.result.pack.brushes[].descriptor` and `.result.pack.computed_presets[].descriptor`. Assert on it with jq `test`, for example `test("tilt_scale_pct: Some")`. + +- **Seed sampled brush.** Run `$H run seed-desc parse fuzz/corpus/preview_abr/unavailable_tips`. Brush `A` at `preset_index` `1` has the all-default descriptor, which starts `BrushDescriptor { spacing_pct: None, computed: None, diameter_px: None,` and ends `tool_options: None, interpolation: None }`, because its preset writes only `Nm ` and `sampledData`. `.result.pack.sampled_brushes[].unavailable` has no `descriptor` key. +- **Seed computed preset.** The same run's `computed_presets[0].descriptor` contains `computed: Some(ComputedGeometry { diameter_px: Some(30.0), hardness_pct: None, angle_deg: None, roundness_pct: None })` and `diameter_px: Some(30.0)`. +- **Default.** Run `$H run seed-v2 parse fuzz/corpus/preview_abr/zero_area_tip` and `$H run seed-nodesc parse fuzz/corpus/preview_abr/sampled_tip`. Every brush's `descriptor` equals brush `A`'s from `seed-desc`, and its `preset_index` is `null`. +- **Mode parity.** Run a real pack with `--mode eager`, `deferred`, `deferred-no-patterns` and `all-deferred`. `[.result.pack.brushes[].descriptor, .result.pack.computed_presets[].descriptor]` is identical across the four runs. +- **Real tool options.** On a v10 corpus pack, `.result.pack.brushes[].descriptor` contains `tool_options: Some(ToolOptions { tool: ""` exactly where `dump` preset `preset_index` has a `toolOptions` item, and `` is that item's `.value.objc.class_id`. +- **Real gating.** On the same pack, every preset whose `dump` item `useTipDynamics` is `{"bool":false}` has `size_jitter_pct: None`, `tilt_scale_pct: None` and `minimum_diameter_pct: None`. +- **Corpus-wide values.** Run `BRUSHKIT_CORPUS_DIR=... cargo test -p brushkit-abr --test corpus_smoke -- corpus_sets_a_nonzero_control_on_every_brvr_panel corpus_sets_a_non_default_value_for_every_tool_setting_and_intr corpus_sets_a_non_default_tilt_scale_on_size_on_pen_tilt every_corpus_mdsl_preset_reads_its_blend_mode_and_opacity`. Four tests pass. They prove the `bVTy` controls, the tool settings, Intr, Tilt Scale and the `MdSl` fallback on real files. + +## Gotchas + +- The `Debug` text is long. Query it with `test` or `capture` instead of reading it. +- With `BRUSHKIT_CORPUS_DIR` unset, the corpus tests print `skip:` and pass, which proves nothing. +- The seeds carry no panel, tool or Intr values. Dual brush, texture, color and the `MdSl` fallback order have only synthetic proof in the unit tests of `crates/abr/src/descriptor.rs`, beyond the corpus tests above. +- `interpolation` is the main tip's `Brsh/Intr`. The dual brush's own Intr is not read. +- `Opct` counts only as wire type `long`. A `doub` gives `opacity_pct: None`. diff --git a/.claude/skills/verify-brushkit/features/parse-abr.md b/.claude/skills/verify-brushkit/features/parse-abr.md index eb59715..fb25534 100644 --- a/.claude/skills/verify-brushkit/features/parse-abr.md +++ b/.claude/skills/verify-brushkit/features/parse-abr.md @@ -32,20 +32,20 @@ Preconditions: - Baseline preconditions from the index hold. - The probe prints `up_front_decoded_len` in `.result.pack` for the three deferred modes only. -- **Eager.** Run `$H run parse-eager parse "$BRUSHKIT_CORPUS_DIR/.abr"`. Exit `0`. `.result.pack.version` is `v6`, `v7` or `v10` for a corpus pack (the library also reads `v1`, `v2` and `v9`), every `.result.pack.brushes[].uuid` is a string, and every `.result.pack.brushes[].tip` has `width`, `height`, `depth` 8 or 16 and `data_len` equal to `width*height*depth/8`. +- **Eager.** Run `$H run parse-eager parse "$BRUSHKIT_CORPUS_DIR/.abr"`. Exit `0`. `.result.pack.version` is one of `v1`, `v2`, `v6`, `v7`, `v9` and `v10`, all present in the corpus. Every `.result.pack.brushes[].uuid` is a string on a v6 or later pack and `null` on v1/v2, and every `.result.pack.brushes[].tip` has `width`, `height`, `depth` 8 or 16 and `data_len` equal to `width*height*depth/8`. - **Mode parity.** Run the same file with `--mode deferred`, `--mode deferred-no-patterns` and `--mode all-deferred` under three labels. `.result.pack.brushes` is identical across all four runs. - **Unavailable brushes.** Run `$H run seed-unavail parse fuzz/corpus/preview_abr/unavailable_tips`. Exit `0`. `.result.pack.brushes` holds only `A` at `preset_index` `1` with `uuid` `a1b2c3d4-e5f6-7890-abcd-ef1234567890`, and `.result.pack.computed_presets` holds `Round` at `2` with `diameter_px` `30`. `.result.pack.sampled_brushes` is `B` at `preset_index` `0` with `.unavailable.cause` `{"unreadable":"no bitmap header found"}`, then `{"readable":0}`, then `C` at `preset_index` `3` with `.unavailable.cause` `{"missing":{"uuid":...}}` and the same uuid as its `id` and `uuid`. The other three modes give the same `sampled_brushes`, because `B` fails in its header. - **Patterns.** Run `$H run seed-patt parse fuzz/corpus/preview_abr/wellformed_v6_patt`. `.result.pack.patterns` is one 2x2 pattern named `tex`, mode `2`. The same seed with `--mode deferred-no-patterns` returns an empty `patterns`. - **Dropped pattern.** Run `$H run seed-dropped parse fuzz/corpus/preview_abr/patt_oversized_channel`. Exit `0` with `.result.pack.diagnostics.dropped_pattern_count` `1`. -- **Dual-brush drops.** Find a corpus pack with a nonzero `dropped_samp_count` by running `--mode all-deferred` over the corpus. At least one v7 pack has `5`. `.result.pack.brushes` still lists every user-facing brush. `.result.pack.diagnostics.dropped_tip_details` lists one entry per dropped tip with `uuid`, `width`, `height` and `owners`, the presets that use it as their dual brush, one entry per preset with `preset_index` and `name`. When records share a uuid, only the record the uuid resolves to lists owners. The details are identical in `eager` and `all-deferred`. -- **Up-front bytes.** On that v7 pack, `.result.pack.up_front_decoded_len` is the same in the three deferred modes and equals `[.result.pack.diagnostics.dropped_tip_details[] | .width*.height] | add` for 8-bit tips. A pack with no dropped tips has `0`. The v2 seed `zero_area_tip` with `--mode all-deferred` has `1`, because v1/v2 tips are always decoded up front. -- **Unreadable unused records.** `.result.pack.diagnostics.unreadable_tip_details` lists each samp record that no sampled brush uses and whose tip does not parse, with `uuid`, `message` and `owners`, each entry with `preset_index` and `name`. No corpus pack or fuzz seed has one, so it is `[]`. To get one, copy the v7 pack outside the repo and zero the bytes that follow the `$` and the uuid in one dropped tip's samp entry, keeping the entry length. The copy lists that uuid with `message` `"no bitmap header found"` and the same `owners` as its dropped tip detail, and `dropped_samp_count` is one lower. Zeroing the uuid too removes the record instead. +- **Dual-brush drops.** Find a corpus pack with a nonzero `dropped_samp_count` by running `--mode all-deferred` over the corpus. Many v6, v9 and v10 packs have one, up to `34`. `.result.pack.brushes` still lists every user-facing brush. `.result.pack.diagnostics.dropped_tip_details` lists one entry per dropped tip with `uuid`, `width`, `height` and `owners`, the presets that use it as their dual brush, one entry per preset with `preset_index` and `name`. When records share a uuid, only the record the uuid resolves to lists owners. The details are identical in `eager` and `all-deferred`. +- **Up-front bytes.** On that pack, `.result.pack.up_front_decoded_len` is the same in the three deferred modes and at least `[.result.pack.diagnostics.dropped_tip_details[] | .width*.height] | add`. It is more when a dropped tip is 16-bit or when several samp records share a uuid, because those records are decoded up front too, so a pack with no dropped tips can still report more than `0`. A v1/v2 pack always does. The v2 seed `zero_area_tip` with `--mode all-deferred` has `1`. `all-deferred` decodes nothing, but the value is the same in every deferred mode, and the other two decode v1/v2 tips up front. +- **Unreadable unused records.** `.result.pack.diagnostics.unreadable_tip_details` lists each samp record that no sampled brush uses and whose tip does not parse, with `uuid`, `message` and `owners`, each entry with `preset_index` and `name`. No corpus pack or fuzz seed has one, so it is `[]`. To get one, copy a pack with dropped tips outside the repo and zero the bytes that follow the `$` and the uuid in one dropped tip's samp entry, keeping the entry length. The copy lists that uuid with `message` `"no bitmap header found"` and the same `owners` as its dropped tip detail, and `dropped_samp_count` is one lower. Zeroing the uuid too removes the record instead. - **Malformed.** Run `$H run seed-bad parse fuzz/corpus/preview_abr/tip_bitmap_dim_overflow`. Exit `1` with `.result.error` `"malformed block at offset 125: bitmap dimensions out of range"`. `v2_rle_overflow` gives `"malformed block at offset 48: samp entry length exceeds buffer"` and `v2_rle_underflow` gives `"malformed block at offset 48: samp entry length shorter than header"`, both exit `1`. ## Gotchas - `eager` and `deferred` read patterns, the other two modes skip them, so `patterns` is empty there by design. -- The corpus and the fuzz seeds other than `unavailable_tips` have no computed presets. `computed_presets` stays empty unless the user supplies a pack with computed tips. +- Of the fuzz seeds, only `unavailable_tips` has a computed preset. Many v6 and v10 corpus packs have them. - A tip whose header parses but whose pixels do not decode is `unreadable` in `sampled_brushes` only where it is decoded up front. A v6/v7/v9/v10 tip is decoded up front in `eager`, and in `deferred` and `deferred-no-patterns` only when it is a dual-brush tip or shares its uuid with another record. A v1/v2 RLE entry is `unreadable` in every mode but `all-deferred`. Where it is not `unreadable`, it is `readable` with the error in its `brushes[i].tip.error`. On such a pack `sampled_brushes` and `brushes` differ across modes by design. An unused v6/v7/v9/v10 record is in `unreadable_tip_details` in `eager`, `deferred` and `deferred-no-patterns`, and in `dropped_tip_details` in `all-deferred`. - Exit `101` means a panic inside the library, which is a bug on any input. - Eager parsing of a 30 MB pack holds every decoded tip in memory. Prefer `all-deferred` for corpus sweeps. diff --git a/.claude/skills/verify-brushkit/features/preview.md b/.claude/skills/verify-brushkit/features/preview.md index 420bd8c..adf8988 100644 --- a/.claude/skills/verify-brushkit/features/preview.md +++ b/.claude/skills/verify-brushkit/features/preview.md @@ -10,7 +10,7 @@ file order. ## Sub-features - `preview-abr` returns one entry per sampled, computed or unsupported preset of an `.abr` pack. -- `preview-computed` draws a computed preset as a square of side `synthesized_tip_side`, with `source_dimensions` null. +- `preview-computed` draws a computed preset as a square of side `synthesized_tip_side`, with `source_dimensions` null. The side is wider than the preset's diameter, because the soft falloff runs past the nominal edge. A computed preset without a diameter of at least 1 px is `UnsupportedTipKind("computed")`. - `preview-brushset` returns every member of a `.brushset`, in `brushset.plist` order, with the set name. - `preview-brushset-no-plist` falls back to zip order with no set name. - `preview-brush` returns the single tip of a `.brush`. @@ -43,12 +43,12 @@ Preconditions: - `missing_shape`: `A` with `"NoShapePng"`. - `oversized_png`: `"TooLarge { width: 60000, height: 60000 }"` with `source_dimensions` 60000x60000. - `deep_archive`: named `Brush` with `"Corrupt(\"Brush.archive: plist nesting depth exceeds limit\")"` and `source_dimensions` 16x8, because the tip size comes from `Shape.png`. -- **Mixed .abr rows.** Run `$H run seed-unavail preview fuzz/corpus/preview_abr/unavailable_tips --kind abr`. The names are `["B","A","Round","C"]`. `B` is `Corrupt("no bitmap header found")`, `A` is available at 4x4, `Round` is the computed preset available at 32x32 with `source_dimensions` null, and `C` is `MissingTip { uuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567892" }`. A `parse` run of the same seed gives `.result.pack.computed_presets[0].synthesized_side` `32`. +- **Mixed .abr rows.** Run `$H run seed-unavail preview fuzz/corpus/preview_abr/unavailable_tips --kind abr`. The names are `["B","A","Round","C"]`. `B` is `Corrupt("no bitmap header found")`, `A` is available at 4x4, `Round`, the computed preset with a 30 px diameter, is available at 36x36 with `source_dimensions` null, and `C` is `MissingTip { uuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567892" }`. A `parse` run of the same seed gives `.result.pack.computed_presets[0].synthesized_side` `36`. - **Zero-area tip.** Run `$H run seed-zero preview fuzz/corpus/preview_abr/zero_area_tip --kind abr`. Entry 0 `brush_1` is `Corrupt("tip has zero area")` with `source_dimensions: null`. Entry 1 `brush_0` is available at 1x1. - **max_cell bound.** Run `$H run cell32 preview "$BRUSHKIT_CORPUS_DIR/.abr" --max-cell 32`. `jq '[.result.entries[].tip.available // empty | [.width,.height] | max] | max'` is at most `32`, and `source_dimensions` match the default run. - **Downsample keeps aspect.** Run `$H run seed-cell4 preview fuzz/corpus/preview_abr/sampled_tip --kind abr --max-cell 4`. The 16x8 source comes back 4x2 with `source_dimensions` still 16x8. - **Tip that fits.** Run `$H run seed-fits preview fuzz/corpus/preview_abr/small_tip --kind abr --max-cell 4`. The 4x4 source comes back 4x4. -- **Budget.** Run `$H run budget preview "$BRUSHKIT_CORPUS_DIR/.abr" --max-cell 16384` on a pack of 150 MB or more. Some entries are `"OverBudget"`, `[.result.entries[].tip.available // empty | .width*.height] | add` is at most `268435456`, and no entry after the first `OverBudget` one is available. +- **Budget.** Run `$H run budget preview "$BRUSHKIT_CORPUS_DIR/.abr" --max-cell 16384` on a pack whose tips hold more than 256 MiB of pixels. Some entries are `"OverBudget"`, `[.result.entries[].tip.available // empty | .width*.height] | add` is at most `268435456`, and no entry after the first `OverBudget` one is available. - **Whole-file failures.** Each exits `1` with `.result.error`: - `sampled_tip --kind abr --max-cell 0`: `"max_cell must be at least 1"`. - `fuzz/corpus/preview_brush/root_brush --kind abr`: `"invalid or truncated ABR file header"`. @@ -58,9 +58,10 @@ Preconditions: ## Gotchas -- The corpus holds no `.brush` files. `preview-brush` on a real file needs one from the user. The seeds cover the mechanics: `root_brush` and `filtered_shape` are available, the others are not. -- The corpus has v6, v7 and v10 packs only. v2 exists only as synthetic seeds such as `zero_area_tip`. No seed or corpus file reaches v1 or v9. -- The corpus has no computed or unsupported presets, so `UnsupportedTipKind` is not reached. `unavailable_tips` is the only computed row. -- An unavailable tip is `Ok` with an unavailable entry. Only a whole-file failure is exit `1`: `max_cell` 0, a bad `.abr` header or block, a zip that does not open, a `brushset.plist` that does not parse, a `.brushset` with no brushes, or a `.brush` without `Brush.archive`. +- The corpus holds `.brush` files, most with one available tip. Of the seeds, `root_brush` and `filtered_shape` are available and the others are not. +- The corpus has v1, v2, v6, v7, v9 and v10 packs. v6 and v10 are most of it. +- Many v6 and v10 corpus packs have computed presets, and some v9 and v10 packs have unsupported presets. Those rows are `UnsupportedTipKind` with the `TipShape` name, such as `"RoundPoint"` or `"ErodibleFlat"`. No seed has an unsupported preset. +- No corpus pack holds more than 256 MiB of tip pixels. The largest holds about 115 MB, so a budget run on the corpus has no `OverBudget` entry. The mechanics are proven by `crates/preview/tests/budget.rs` and the budget unit tests in `crates/preview/src/lib.rs`. +- An unavailable tip is `Ok` with an unavailable entry. Only a whole-file failure is exit `1`: `max_cell` 0, a bad `.abr` header or block, a zip that does not open, a `brushset.plist` that does not parse, a `.brushset` with neither a `brushset.plist` nor a brush directory, or a `.brush` without `Brush.archive`. A `brushset.plist` whose `brushes` array is empty is `Ok` with no entries. - A budget run holds up to 256 MiB of bitmaps and about 650 MB of memory. - `sheet.png` holds only available tips, so its cell count can be lower than `.result.counts.entries`. diff --git a/.claude/skills/verify-brushkit/features/stop.md b/.claude/skills/verify-brushkit/features/stop.md index 7a3e8aa..3b99618 100644 --- a/.claude/skills/verify-brushkit/features/stop.md +++ b/.claude/skills/verify-brushkit/features/stop.md @@ -30,7 +30,7 @@ Preconditions: - **Not stopped.** The same seed with `--stop-after 4` has 4 entries, `not_reached` `0` and `keep_going_calls` `4`, because `keep_going` is not asked about an entry that does not exist. - **First available.** The same seed with `--first 1 --stop-after 100` returns `A` at index 1 with `not_reached` `0` and `keep_going_calls` `2`. With `--first 2 --stop-after 1` it returns no entries, `not_reached` `3`, because the unavailable `B` was built first. - **Set and brush.** Run `$H run stop-set preview fuzz/corpus/preview_brushset/ordered_set --kind brushset --stop-after 1`. One entry `B`, `set_name` `"Ordered"`, `not_reached` `1`. `fuzz/corpus/preview_brush/root_brush --kind brush --stop-after 0` has no entries and `not_reached` `1`. -- **Real pack.** Run `$H run stop5 preview "$BRUSHKIT_CORPUS_DIR/.abr" --stop-after 5` and a full run of the same pack. `stop5` has 5 entries equal to the first 5 of the full run, and `not_reached` is `counts.entries` of the full run minus 5. +- **Real pack.** Run `$H run stop5 preview "$BRUSHKIT_CORPUS_DIR/.abr" --stop-after 5` and a full run of the same pack, which has more than 5 entries. `stop5` has 5 entries equal to the first 5 of the full run, and `not_reached` is `counts.entries` of the full run minus 5. ## Gotchas diff --git a/.claude/skills/verify-brushkit/probe/src/main.rs b/.claude/skills/verify-brushkit/probe/src/main.rs index d8a7f4f..95515c7 100644 --- a/.claude/skills/verify-brushkit/probe/src/main.rs +++ b/.claude/skills/verify-brushkit/probe/src/main.rs @@ -138,6 +138,8 @@ fn tip_json(tip: &abr::TipBitmap) -> Value { json!({ "width": tip.width, "height": tip.height, "depth": tip.depth, "data_len": tip.data.len() }) } +/// `descriptor` is the `Debug` text of a `BrushDescriptor`, which has no serde +/// derive. fn pack_json(pack: &AbrPack, tip: impl Fn(usize) -> Value) -> Value { json!({ "version": pack.version.to_string(), @@ -149,6 +151,7 @@ fn pack_json(pack: &AbrPack, tip: impl Fn(usize) -> Value) -> Value { "name": b.name, "preset_index": b.preset_index, "tip": tip(i), + "descriptor": format!("{:?}", b.descriptor), })).collect::>(), "sampled_brushes": pack.sampled_brushes.iter().map(|s| match s { SampledBrush::Readable(i) => json!({ "readable": i }), @@ -173,6 +176,7 @@ fn pack_json(pack: &AbrPack, tip: impl Fn(usize) -> Value) -> Value { "angle_deg": g.angle_deg, "roundness_pct": g.roundness_pct, "synthesized_side": preview::synthesized_tip_side(&g), + "descriptor": format!("{:?}", p.descriptor), }) }).collect::>(), "patterns": pack.patterns.iter().map(|p| json!({