forked from 1b-agent/opencadstudio-upstream
A different-methods review round (seeded fuzzing over the pure logic,
manual mutation testing of the suites, mechanical static scans) found
what the code-reading rounds could not:
Fuzz (randomized inputs, minimized repros):
- json_values_match matched unequal integers beyond f64 precision:
the mixed integer/float arms compared via `as f64`, so every u64
past 2^53 round-tripped onto a neighbouring float and a
compare-and-set could pass against a DIFFERENT value. Whole floats
now equal an integer only when it is exactly representable
(round-trip lossless); pinned by a regression test the mutation
round had shown was missing.
- recovered_name smuggled path separators through the extension
("a.b/c" -> "a (recovered).b/c") because only the head was
reduced to its final path component — the whole input is now
sanitized first, and the empty-stem fallback uses the sanitized
component, which also restores idempotence for separator-headed
names ("/.dwg" used to alternate across crash cycles).
Mutation (12 one-line mutations, 9 caught / 4 survived — the
survivors were the holes, now closed):
- PDF tie order image-vs-wire-fill was untested (rank swap passed all
17 pdf_export tests) — see follow-up note; snap endpoint-map bucket
width and the drop-queue cap remain native-untestable (wasm-only
modules) — noted as the structural gap, not fixed here.
Static scans (panic reachability / unbounded growth / lock ordering):
- no reachable input-driven panic in the branch's new code; no
inconsistent lock ordering; the image source registry and the
pdf_raster page/source caches lack any cap or eviction (the xref
registry's SOURCE_CAP LRU is the in-repo template) — flagged,
deferred as follow-up rather than rushed at the end of a session.
The fuzz suite itself (tests/fuzz_round.rs, 12 properties, 4 seeds)
ships with replicas updated to the fixed logic — all green.