Releases: fork-tongue/patchdiff
Release list
v1.0.0
What's Changed
Documentation
- MkDocs + Material docs site with an API reference (mkdocstrings), a guide (diffing, applying patches,
produce()/drafts, serialization, observ integration), and an internals section covering the list-diff algorithm, proxy design, and pointer semantics (#49) - Rewritten README pointing at the docs site
- Rewrite docs prose in a plainer style (#61)
Typing
- Full modern type hints (PEP 604 unions, builtin generics) checked with
tyin CI,OperationTypedDicts for patch shapes,py.typedmarker (#49, #50, #52)
Test hardening
- Hypothesis-based property tests for round-trip diff/apply/iapply/produce and pointer escaping, plus a vendored RFC 6902 conformance corpus (#51, #60)
CI & benchmarking
- Modernized workflows (pinned actions, uv caching, trimmed steps) (#47)
- Noise-robust benchmark guard: interleaved master/PR runs compared by fastest-vs-slowest median rather than a single noisy sample (#48)
Performance
- List diff rewritten from an O(m·n) DP table to Myers' O((m+n)·D) algorithm (#53)
produce()hot-path redesign: lazy path recording and epoch-based location memoization instead of eagerPointerallocation on every write (#54)- Micro-optimization passes across diff, apply/iapply, and the produce proxy call paths (#55, #56, #57)
Full Changelog: v0.3.12...v1.0.0
Benchmarks: 1.0.0 vs 0.3.12
Median times from 3 interleaved local runs per side (PYTHONHASHSEED=0, GC disabled), same methodology as CI's benchmark guard.
| Benchmark | 0.3.12 | 1.0.0 | Δ |
|---|---|---|---|
list_diff_medium[0.1] (Myers vs DP) |
340.4 ms | 1.85 ms | −99.5% |
list_diff_completely_different |
356.7 ms | 107.8 ms | −69.8% |
dict_diff_flat_500_keys |
328.3 µs | 148.8 µs | −54.7% |
set_diff_1000_elements |
87.4 µs | 60.7 µs | −30.5% |
produce_deep_leaf_writes[copy] |
216.8 µs | 133.5 µs | −38.4% |
produce_in_place_vs_copy_dict |
218.8 µs | 188.4 µs | −13.9% |
diff_dict_many_mutations |
1.46 ms | 1.19 ms | −18.3% |
apply_dict_many_ops |
839.8 µs | 788.1 µs | −6.2% |
The list-diff rewrite dominates: cases with large or scattered edit distance see order-of-magnitude wins, since the DP table's O(m·n) cost no longer applies. A handful of list_diff_similar_* benchmarks (many small localized edits already handled well by the prefix/suffix trim) show a mild regression instead — up to +19% — from Myers' bookkeeping overhead on inputs where the old approach had little left to do; this sits within the noise floor (10–30% run-to-run) and wasn't worth chasing further given the wins elsewhere. Everything else lands within a few percent either way.
v0.3.12
This release includes the following:
- Fix proxy leaks and stale paths in produce() (#44)
v0.3.11
This release contains the following change:
- Simplify deepcopy (#42)
Bumps observ dependency which fixes a problem with stale proxies being used
v0.3.10
Bump version to 0.3.10 (#41)
This version includes the following:
- ci: Update versions of steps and let setup-uv manage the python version (#40)
- perf: trim common prefix/suffix in diff_lists (#36)
- perf: use str.replace in Pointer escape/unescape (#37)
- fix: produce() snapshots mutable values when recording patches (#34)
- perf: linear reverse-op construction in diff_dicts/diff_sets (#38)
- fix: iapply raises on invalid patch paths (#35)
- fix: to_json mutating caller's ops (#33)
v0.3.9
v0.3.8
Bump version to 0.3.8 (#30)
This version includes the following functionality:
- Updated CI actions and auto-format (#29)
- Implement proxy-based patch generation (adds
producemethod, inspired by Immer) (#28)
Known issue
The introduced produce method misses some edge cases and will be fixed in the next release. See #31 .
v0.3.7
What's Changed
- Fix for
__version__being different from packaged version by @berendkleinhaneveld in #25 - Micro-optimization by @Korijn in #26
- Bump version to v0.3.7 by @Korijn in #27
Full Changelog: v0.3.6...v0.3.7
v0.3.6
Bump version to 0.3.6 (#24) * Iterative Levenshtein distance (can handle larger diffs now) (Iterative Levenshtein distance #21) * Add benchmark and workflow (Add benchmark and workflow (based on observ's) #22)
v0.3.5
Tooling update (#20) * Migrate from poetry to uv * Configure trusted publishing to PyPi * Ignore uv.lock * Migrate flake8 and black to ruff * Fix for Python 3.9 and 3.8 * No need to checkout the code when publishing * Revert "No need to checkout the code when publishing" This reverts commit 94a59bf4f0e331c0a616f2cd2fee086c4d3b98c8. * Bump version to 0.3.5
Release v0.3.4
Push test coverage to 100% and bump version (#18) * push test coverage to 100% * bump version * maintain tokens inside pointer as a tuple * add test for Pointer.append