Skip to content

Patternia v0.8.0 Release Note

Release Date: February 27, 2026
Version: 0.8.0


Overview

Patternia v0.8.0 is an API and performance release.

Compared with v0.7.6, this version removes the legacy compact terminal form and focuses the public usage on match(x) | on(...). It also upgrades variant dispatch internals with a tiered hot/warm/cold strategy for better large-branch behavior.


Highlights

API Update (Breaking)

  • Removed legacy terminal API:
  • legacy compact terminal form
  • Recommended forms in v0.8.x:
  • match(x) | on(...);

Performance: Core Dispatch Algorithms in v0.8.0

  • Added explicit variant dispatch tiering:
  • hot_inline for small alternative counts
  • warm_segmented for medium alternative counts
  • cold_compact for large alternative counts
  • Added compact index mapping for large typed-variant dispatch:
  • active_index -> compact slot
  • miss goes directly to fallback path
  • hit jumps into dense trampoline table
  • Added typed-variant per-alt case-range narrowing:
  • only scans the relevant case range for the active alternative
  • Retained direct-reference bind fast path for variant typed bindings to reduce tuple plumbing on common paths.
  • Separated hot entry logic from cold large-branch logic using non-inline cold helpers to reduce hot-path code footprint.

Internal Architecture Cleanup

  • Further separated optimization metadata from runtime evaluation flow:
  • strategy/metadata stays in optimize.hpp
  • runtime execution stays in eval.hpp

Migration Guide

If you still use the removed compact terminal API, migrate to pipeline syntax.

After:

auto r = match(x) | on(
  lit(1) >> [] { return 1; },
  _ >> [] { return 0; }
);

Compatibility Notes

  • API surface: breaking change in 0.8.0 due to removal of the compact terminal API.
  • Runtime semantics: unchanged for equivalent case ordering and fallback behavior.
  • Source compatibility: users of match(x) | on(...) remain compatible.

Implementation Notes

  • include/ptn/core/common/optimize.hpp
  • Added dispatch tier model and variant metadata helpers.
  • include/ptn/core/common/eval.hpp
  • Integrated hot/warm/cold dispatch flow and cold-path helpers.
  • Updated typed/simple variant dispatch to use compact metadata.