Skip to content

0.17.0: Revision fn and new macro generated accessors.#39

Merged
MathisWellmann merged 6 commits into
mainfrom
revision-fn
Jul 18, 2026
Merged

0.17.0: Revision fn and new macro generated accessors.#39
MathisWellmann merged 6 commits into
mainfrom
revision-fn

Conversation

@MathisWellmann

Copy link
Copy Markdown
Owner
  1. revision: add RevisionFn typed handles that pin retained revisions
  2. macros: generate _fn accessors returning typed RevisionFn handles — evolvable! { fn decide(...) } now also emits decide_fn(revision) -> Option<RevisionFn<fn(...) -> ...>>.
  3. bench: measure RevisionFn handle calls; compile the bench dylib in release. The handle is as fast as the active dispatch.
  4. evolving-trader: run a top-3 ensemble out-of-sample via revision handles — the search now keeps TOP_K = 3 seats; after the single-best report, all three revisions run side by side on the held-out segment, each candle averaging their signed order quantities into one net market order.
  5. doc: ... — README typed-handles highlight, refreshed dispatch table, contract-exemption note; CAVEATS per-revision panic buffers (also fixed a stale symbiont::catch_panic reference).
  6. release: bump version to 0.17.0.

RevisionFn<F> holds the typed symbol pointer plus an Arc on its
RevisionEntry (registry entries are now Arc-wrapped), so calls through a
handle stay valid regardless of the active revision, future evolutions,
or any later pruning API. Handles are Send + Sync + Clone, expose get()
for hoisting the bare fn pointer into hot loops, and take_panic() reads
the correct per-revision panic buffer (shared with Runtime::take_panic
via read_panic_buffer). revision_fn_lookup resolves handles for the
macro by decl pointer identity — no strings involved.
For each evolvable fn the macro now also emits an accessor (e.g.
decide_fn(revision)) that resolves a RevisionFn typed with the declared
signature. The lookup goes through the hidden runtime hook by decl
pointer identity, and the only unsafe involved is the same
validated-signature cast the dispatch wrapper already relies on. The
integration test covers handle independence from the active revision,
Send + Clone fan-out concurrent with activate_revision, and per-revision
panic routing.
…lease

Adds a revision_handle case (fetch once, hoist with get(), call in the
loop). Also switches the benched runtime to Profile::Release: with a
debug-profile dylib the callee codegen (~5ns) drowned the dispatch
difference the bench exists to measure. Measured: direct 0.94ns,
evolvable dispatch 1.50ns, revision handle 1.47ns.
Keep the TOP_K best strategies (by training return) during the search
instead of only the single best. After the final report, fetch a typed
decide_fn handle for each seat — every member dylib is still loaded —
and backtest an equal-weight ensemble on the held-out test segment:
each candle all members vote and their signed quantities are averaged
into one net market order. run_backtest is generalized to
run_backtest_with(decide_impl, take_panic, candles) so handles (and
combinations of them) backtest exactly like the active revision.
Refresh the dispatch table with numbers measured against a
release-compiled dylib and note the per-revision panic buffers.
Typed RevisionFn handles, the <name>_fn macro accessors, and the
ensemble showcase are additive API.
@MathisWellmann MathisWellmann self-assigned this Jul 17, 2026
@MathisWellmann
MathisWellmann merged commit 03a6c07 into main Jul 18, 2026
4 checks passed
@MathisWellmann
MathisWellmann deleted the revision-fn branch July 18, 2026 11:45
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