Skip to content

release: v0.9.3 — neg(p) pattern combinator, variant dispatch optimization, user guides#31

Merged
sentomk merged 4 commits intomainfrom
v0.9.3
May 4, 2026
Merged

release: v0.9.3 — neg(p) pattern combinator, variant dispatch optimization, user guides#31
sentomk merged 4 commits intomainfrom
v0.9.3

Conversation

@sentomk
Copy link
Copy Markdown
Owner

@sentomk sentomk commented May 4, 2026

Summary

Patternia v0.9.3 — cumulative release since v0.9.2. Adds pred(callable) first-class predicate, neg(p) negation combinator, literal_runtime_dense dispatch tier, variant inline dispatch optimization, val<> compile-fail diagnostic, and comprehensive documentation.

Changes

New Features & API

Feature PR Description
pred(callable) #15 First-class predicate pattern — match via user-defined callable
neg(p) #29 Negation pattern combinator — invert sub-pattern result. Composable with any/all, zero binding
literal_runtime_dense dispatch #24 New optimization tier for runtime literal pattern dispatch
val<> compile-fail diagnostic #29 Clear compile-time error when val<> is misused with runtime values

Performance Optimizations

Change Description
Runtime range check optimization Replace two-sided comparison with single unsigned comparison
PTN_ON matcher inline Skip static_on function boundary for zero-overhead cached path
val<n> standard literal dispatch #26 Use val shorthand for literal match dispatch
Variant inline threshold 16 → 8 Hot inline dispatch path for ≤8 alternatives

Documentation

File Description
docs/changelog/v0.9.3.md Full v0.9.3 release note
docs/guide/performance-tuning.md PTN_ON, val vs lit, structural bindings, variant dispatch
docs/guide/common-mistakes.md 6 common pitfalls with code examples
docs/performance/v0.9.3.md Variant dispatch threshold tuning analysis
docs/api/api.md neg(p) API reference added
README.md neg example, version tag 0.9.3

Infrastructure

Change Description
CT benchmarks + lit bench expansion #22 Compile-time benchmark harness + expanded literal-match scenarios
PR template #19 Standardized PR description template
Coverage badge + benchmark chart CI-collected coverage and performance data in README

Tests

  • 4 new neg(p) unit tests: basic, neg(_), neg(pred(...)), neg(neg(p))
  • 1 compile-fail test: val<>(runtime_value)
  • CT benchmark static_assert probes
  • Full ctest: 154/154 pass, no regressions

Risk

Low. All new features are additive — no breaking API changes. Performance optimizations are internal dispatch changes, existing behavior unchanged.

Checklist

  • Tests added or updated when behavior changed
  • Documentation updated when public API or behavior changed
  • Commit messages follow CONTRIBUTING.md
  • PR targets main and passes required CI

sentomk and others added 4 commits May 4, 2026 21:06
…zation + val<> compile-fail diagnostic (#29)

- Add neg(p) negation pattern combinator (46 LOC, negation.hpp)
- Lower k_variant_inline_dispatch_alt_threshold from 16 to 8 (optimize.hpp)
- Add compile-fail test for val<>(runtime_value) misuse
- Wire neg into patternia.hpp public API
…ce note (#30)

* docs: add performance tuning and common mistakes guides

- docs/guide/performance-tuning.md: PTN_ON macro, val<> vs lit(), structural binding, variant dispatch
- docs/guide/common-mistakes.md: 6 common mistakes with val<> runtime misuse, missing wildcard, lambda captures, etc.

* docs: bump version to 0.9.3 + add neg(p) to API reference

- CMakeLists.txt: VERSION 0.9.2 → 0.9.3
- README.md: GIT_TAG v0.9.2 → v0.9.3
- docs/api.md: add neg(p) section with example + namespace summary

* docs(release): add v0.9.3 release note, update releases index, add neg example to README

* docs(perf): add v0.9.3 performance note (variant dispatch threshold tuning)

* docs(release): add performance section link to v0.9.3 release note
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 87.20930% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tests/tests_combinator.cpp 86.25% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sentomk sentomk merged commit 5fe7cef into main May 4, 2026
21 checks passed
sentomk added a commit that referenced this pull request May 4, 2026
* release: v0.9.3 — neg(p) pattern combinator, variant dispatch optimization, user guides (#31)

* feat: add neg(p) pattern combinator + variant inline threshold optimization + val<> compile-fail diagnostic (#29)

- Add neg(p) negation pattern combinator (46 LOC, negation.hpp)
- Lower k_variant_inline_dispatch_alt_threshold from 16 to 8 (optimize.hpp)
- Add compile-fail test for val<>(runtime_value) misuse
- Wire neg into patternia.hpp public API

* docs: v0.9.3 release documentation — guides, release notes, performance note (#30)

* docs: add performance tuning and common mistakes guides

- docs/guide/performance-tuning.md: PTN_ON macro, val<> vs lit(), structural binding, variant dispatch
- docs/guide/common-mistakes.md: 6 common mistakes with val<> runtime misuse, missing wildcard, lambda captures, etc.

* docs: bump version to 0.9.3 + add neg(p) to API reference

- CMakeLists.txt: VERSION 0.9.2 → 0.9.3
- README.md: GIT_TAG v0.9.2 → v0.9.3
- docs/api.md: add neg(p) section with example + namespace summary

* docs(release): add v0.9.3 release note, update releases index, add neg example to README

* docs(perf): add v0.9.3 performance note (variant dispatch threshold tuning)

* docs(release): add performance section link to v0.9.3 release note

* style: apply clang-format to PR changes

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* ci: update benchmark summary chart

* hotfix(nav): add v0.9.3 to performance sidebar

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant