Repository navigation
Add accumulation yield estimator and controller to the numerical library - #91
Conversation
Copy episode_workflow's accumulation yield estimator unchanged into the numerical function library and bind it to Grain.controller. The estimator judges an ordered score record by the chance that its present dry stretch is only a gap at the record's own yielding rate. With outstanding credit stated, it stops when that chance times the credit still on offer falls below the score resolution. There is no window and no unit count. - numeric_control_library/accumulation.py: the source file, byte-identical. - numeric_control_library/accumulation_control.py: registers rarefaction.accumulation_yield_v1 and controller_composition.compose_accumulation_controller, with AccumulationObservation at the closed-record boundary. - EpisodeBuilder catalog, constructor admission and emitter contract. The Chao2 estimator, its composition and approved Architecture bindings are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
૮ >ﻌ< ა ci reviewrunning on fd83ef6 — Merge main into feat/accumulation-yield Still running 17 jobs: ❌ Job failuresOS-specific tests / macOS-only tests · View jobJob OS-specific tests / macOS-only tests failed. |
…cumulation curve
The estimator copied in the previous commit turned every observation into
productive or dry and decided from those counts. The source repository has
replaced it, and this brings the copy and its bindings in line.
The estimator now fits one curve to the whole accumulated score. It starts
from a stated initial expectation, in credit per observation, which every
observation then moves: a gain up by its size, an observation without gain
down.
yield_expectation = (initial_expectation + credit gained) / (observations + 1)
With outstanding credit weighed, one rate is fitted against the credit on
offer at each point of the record:
exposure = outstanding at the start + outstanding before each observation
yield_rate = (initial_expectation + credit gained) / exposure
yield_expectation = outstanding now * yield_rate
The Episode stops when the expectation is below the score resolution, or at
once when nothing is outstanding or the score has reached its ceiling. A
record that loses credit is fitted on the most credit held so far, so credit
earned back is not a new gain and recovery does not stop the record.
- numeric_control_library/accumulation.py: the new source file, byte-identical
(SHA-256 71e29778cbe46b27794c9b1dcdc7aa0091683790f090b864674795409d0159bb).
- numeric_control_library/accumulation_control.py: parameters are the required
score_resolution and initial_expectation and the optional max_score and
weigh_outstanding; efficiency_fraction, initial_productive and initial_dry
are removed. estimate_accumulation_yield and the controller pass the
outstanding credit at every score instead of one scalar, an unknown start
taking the first stated value. The admission scenarios test the fitted
behaviour and none tests a count.
- Emitter contract, docs page and README pointer state the new parameters,
formulas and report fields.
- Tests rewritten against the formulas; none reads a removed field.
Registration ids and interfaces are unchanged. Not ported, as before: the
source repository's root observes every descendant unit and a stopped ancestor
stops its descendants; here each Episode path keeps its own record.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main gained the value-of-computation estimator (#89), which registers in the same catalog, admission and export lists as the accumulation estimator. Both sets of entries are kept. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Both this branch and the preferential discovery estimator merged in #90 register an estimator in the same places and describe it in the README. Keep both. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FfzyrvFGRVKR5LMMXbXonU
Accumulation yield estimator and controller
Adds episode_workflow's accumulation yield estimator to the numerical function
library and binds it to
Grain.controller. The Chao2 estimator, itscomposition and approved Architecture bindings are unchanged.
This revision replaces the estimator first copied in this PR. That one
classified each observation as productive or dry and decided from those
counts. The estimator now fits one curve to the whole accumulated score. There
is no window, no count threshold and no tally of productive or dry steps.
The math
The input is an ordered score record: a starting score, then one score per
completed unit.
initial_expectationis the yield expectation before the firstobservation, in credit per observation. It is the starting value of that one
number, not a multiplier on it: every observation then moves it, a gain up by
its size and an observation without gain down.
A record that never gains reads
initial_expectation / (observations + 1).With
weigh_outstanding, one rate is fitted against the credit still on offerat each point of the record:
The Episode stops when, after at least one observation, the expectation is
below
score_resolution(saturated), or at once when nothing is outstandingor the score has reached
max_score(complete).A record that loses credit is fitted on the most credit held so far. Credit
earned back is not a new gain and the observations it took are still exposure,
so
0, 1, 2, 3, 4, 1, 2, 3, 4is fitted as gained 4 over 9, and theexpectation falls smoothly through the recovery instead of dropping at it.
Behaviour to know before choosing parameters
initial_expectation / score_resolutionobservations for arecord that never gains, and each credit gained adds
1 / score_resolutionobservations. A coarse resolution with a small initial expectation therefore
stops quickly, including during a recovery.
In episode_workflow a free two-parameter saturating fit stopped 17 of 29
recorded runs before later credit, because those runs find a few values
early and then go long stretches dry.
one; outstanding credit changes the expectation only as it is earned.
What is in the change
numeric_control_library/accumulation.py: the source file, byte-identical(SHA-256
71e29778cbe46b27794c9b1dcdc7aa0091683790f090b864674795409d0159bb).The source file is not yet committed in episode_workflow, so the hash is its
only identifier.
numeric_control_library/accumulation_control.py: registersrarefaction.accumulation_yield_v1andcontroller_composition.compose_accumulation_controller, withAccumulationObservationat the closed-record boundary.score_resolutionandinitial_expectation;optional
max_scoreandweigh_outstanding.estimate_accumulation_yield(score_record, parameters, outstanding_history=None)takes the outstanding credit at every score. The controller keeps that
history; an unknown start takes the first stated value.
should_yield,outcome,score,max_score,observations,gained,exposure,yield_rate,yield_expectation,stop_below,score_resolution,initial_expectation,outstanding.raising the expectation, gain size, outstanding weighing and immediate
completion, withdrawal and recovery, early patience, determinism.
docs/openchia/accumulation_yield.mdand a README pointer.Removed relative to the first revision:
efficiency_fraction,initial_productive,initial_dry, the scalaroutstanding=argument, andthe report fields
productive_observations,dry_observationsandyielding_rate.Not ported
stopped ancestor stops its descendants. That wiring lives in its engine.
Here each Episode path keeps its own record, and a parent observes one unit
per child return.
initial_expectationdefault tomax_score; thebinding here requires it.
Tests
tests/numeric_control_library/test_accumulation_yield.pyandtests/episode_builder/test_accumulation_catalog.py: 37 passed.main(which now includes Add value-of-computation yield estimator and reusable Episode adapter #89): 130 passed, 5 failed. The same 5 fail onmainand are unrelated to this change:
tests/episode_builder/test_api_failure_continuation.py::test_api_failure_stops_builder[emission]tests/episode_builder/test_repeatable_call_materialization.py(2)tests/method_loop/test_episode_tree_recursion.py(2)ruff checkon the changed files andgit diff --checkare clean.🤖 Generated with Claude Code