Skip to content

docs(experiments): restate #252 and #255 on a production-faithful engine, and record why the defects were invisible - #261

Merged
eaitbrahim merged 1 commit into
mainfrom
docs/amend-for-engine-fixes
Aug 13, 2026
Merged

docs(experiments): restate #252 and #255 on a production-faithful engine, and record why the defects were invisible#261
eaitbrahim merged 1 commit into
mainfrom
docs/amend-for-engine-fixes

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

Both experiments re-run under #256 (pending setups no longer freeze the detector) and #258
(entries fill at the next bar's open, as production's market orders do). Same designs, same
combinations, same fee grid and slippage pin — only the engine differs.

Every conclusion survives except one

ZEC-turtle no longer clears the maker line — 1.034 → 0.968. That collapses #252 §6's
architecture: its three-probe narrative (fee curve, tail-sensitivity, temporal — each catching what
the others miss, with ZEC as the through-line) describes a survivor the faithful engine never
produces.

The replacement is shorter and worse for the library: the viable quadrant is empty at every
reachable fee — 0 of 90 in #252, 0 of 82 in #255 — with nothing needing three gates to die.
The
probes aren't worthless; they're repositioned from "what killed the last survivor" to
"forensics explaining an artifact a defective engine manufactured."

#255 strengthens: the level shift widens from 1.1631 → 0.8938 to 1.1251 → 0.8396,
gross-positive cells at the floor nearly halve (11/76 → 6/82), and the 34× UNI-USD monotonicity
anomaly that exposed both defects is structurally gone (3 assets → 0) — an independent check on
the fixes, not a restatement.

The two defects pushed opposite ways

#256 suppressed opportunity; #258 flattered execution. Correcting both didn't add noise
— it moved everything one way:

trade counts rose in     87 of 90
gross profit factors fell in 69 of 90

Every prior conclusion in docs/experiments/ was measured on an engine simultaneously too
pessimistic about how often a rule fires and too optimistic about what it pays to get in.

Arm B, restated on a single engine

in-sample  0.5770   out-of-sample 0.5427   gap 0.034

#252 reported 0.6335 vs 0.6346 — a three-decimal agreement across one engine each, so partly
luck. Conclusion unchanged and now engine-consistent: the sweep winner is not overfit, it is
stably unprofitable.

§5 is the part worth reading

Neither defect was found by looking for defects, and neither was findable by the means we had.
2,712 tests passed throughout. #256 surfaced only from a 34× non-monotonicity visible because a
grid happened to sweep wide enough; #258 only from asking why #256's fix reduced trade counts.

The reason tests couldn't catch either generalises:

A frozen backtest and a highly selective strategy produce identical-looking output. So do a
patient limit fill and a lucky one. Nothing about n, win rate or profit factor distinguishes "the
rule declined to fire" from "the engine stopped asking."

Adding tests doesn't fix that — a test asserts behaviour someone already imagined. The document
recommends invariants the engine reports about itself: a dead-tail warning (#256 had a
4.7-year dead tail in plain sight of every run), intent-vs-fill divergence logging (#260 — the
order row already stores both numbers and nothing compares them), and cost anchored to output
(#247, shipped, and the model for the rest).

Also corrected: a distinction that would have misled future work

pullback_continuation's median n doubled (58 → 124) when the market fill removed its offset
entry. That is not evidence offset entries generate alpha — both sides lose money gross
(0.9219 filtered, 0.7736 unfiltered). The filter separated bad from worse. §3.1 says so explicitly
so this dataset can't later be cited the other way.

Method

Annotates rather than rewrites, per the convention #247 set — "past numbers were real outputs
of the code as it stood; they are annotated by this change, not restated."
Both documents keep
their figures and carry a banner pointing here, so each remains a true record of what its engine
produced.

Two ledger rows (diagnostic_only for the intersection restatement, rejected for the rsi grid,
which decides against the rule); verify_chain clean at 85. Both re-run harnesses committed.
2711 passed, 1 skipped.

🤖 Generated with Claude Code

…ine, and record why the defects were invisible

Both experiments re-run under #256 (pending setups no longer freeze the detector) and #258
(entries fill at the next bar's open, as production's market orders do). Same designs, same
combinations, same fee grid and slippage pin -- only the engine differs.

EVERY CONCLUSION SURVIVES EXCEPT ONE. ZEC-turtle no longer clears the maker line (1.034 -> 0.968),
so #252 section 6's three-probe narrative describes a survivor the faithful engine never produces.
The replacement is simpler and worse for the library: the viable quadrant is empty at every
reachable fee -- 0 of 90 in #252, 0 of 82 in #255 -- with nothing needing three gates to die.

#255 strengthens: the level shift across the trade floor widens from 1.1631 -> 0.8938 to
1.1251 -> 0.8396, gross-positive cells at the floor nearly halve (11/76 -> 6/82), and the 34x
UNI-USD monotonicity anomaly that exposed both defects is structurally gone (3 assets -> 0).

The two defects pushed in OPPOSITE directions -- #256 suppressed opportunity, #258 flattered
execution -- so correcting both moved everything one way rather than adding noise: trade counts
rose in 87 of 90, gross profit factors fell in 69 of 90.

Arm B's transfer is restated on a single engine: 0.5770 in-sample vs 0.5427 out-of-sample, a gap
of 0.034. #252's 0.6335 vs 0.6346 compared figures from one engine and was partly luck. The
conclusion is unchanged -- the sweep winner is not overfit, it is stably unprofitable.

Records the operational takeaway as section 5: NEITHER DEFECT WAS FOUND BY LOOKING FOR DEFECTS,
and neither was findable by the means we had. 2,712 tests passed throughout. A frozen backtest and
a highly selective strategy produce identical-looking output, so no summary ledger distinguishes
them. The fix is invariants the engine reports about itself -- a dead-tail warning, intent-vs-fill
divergence logging (#260), and cost anchored to output (#247, shipped, and the model for the rest)
-- not more unit tests, which only assert behaviour someone already imagined.

Annotates rather than rewrites, per the convention #247 set: the original numbers were real
outputs of the code as it stood. Both documents keep their figures and carry a banner pointing
here.

Two ledger rows; chain verifies clean at 85.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@eaitbrahim
eaitbrahim merged commit 2ed1a3f into main Aug 13, 2026
1 check passed
@eaitbrahim
eaitbrahim deleted the docs/amend-for-engine-fixes branch August 13, 2026 05:06
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