Skip to content

Rogue SPR: prototype Pol & Escapa (Fitch) leaf selector (#174) - #226

Open
ms609-agent wants to merge 3 commits into
mainfrom
claude/rogue-polescapa
Open

ms609-agent wants to merge 3 commits into
mainfrom
claude/rogue-polescapa

Conversation

@ms609-agent

Copy link
Copy Markdown
Collaborator

Research prototype for #174, with no package code changes. It asks whether a Pol & Escapa (2009)-style leaf-instability score can choose which leaf SPRDist(method = "Rogue") drops, in place of the per-candidate bounded-MCI scoring.

Write-up: dev/rogue_polescapa_findings.md. Scripts, reference set and results: dev/rogue_polescapa/.

Method. Each split of one tree is treated as a binary character and scored with Fitch on the other tree, in both directions. A leaf's score is the number of steps saved when that leaf is coded ? in every character. One downpass and one uppass give every leaf's score. A bit-parallel C++ kernel is included (fitch_bitpar.cpp).

Recommendation. Adopt it as the selector, with MCI used only to break ties among the leaves with the top Fitch score (both-tied).

  • Exact references. These are 528 pairs of ≤ 32 leaves with exact uSPR, including the two fixtures recovered from git history. both-tied is equal or better than the current selector everywhere except random pairs of 8–14 leaves: there it over-estimates by one move on 21 of 120 pairs, against 9 for the current selector.
  • 50–150 random leaves. Measured against best-known (the lowest estimate any variant gave), the mean excess is 0.47–0.90 moves, against 1.97–4.60 for the current selector. It gives a lower estimate on 52 pairs and a higher one on 1.
  • Cost. The Fitch kernel takes 25–170 µs per iteration, against 1.5–108 ms for spr_rogue_scores(). A harness that uses pure Fitch runs about 2×, 10× and 40× faster than SPRDist at 30, 80 and 150 leaves. The cost of both-tied is projected rather than measured: it would score 2–3 tied candidates in 30–46% of iterations.
  • Variants that lose. One scoring direction alone does worse than the current selector. A top-k pre-filter followed by MCI does no better than both-tied and costs more.

A C++ implementation is being worked on separately and depends on the src/spr.cpp incremental-fill work landing first.

🤖 Generated with Claude Code

ms609-agent and others added 3 commits October 23, 2026 10:52
Research only; no package code changes. Scores each leaf by the Fitch
length it adds when each tree's splits are treated as binary characters
on the other tree, with MCI breaking ties. Compared with the current
bounded-MCI selector against exact uSPR (528 pairs, <= 32 leaves) and
best-known estimates (50-150 leaves); findings in
dev/rogue_polescapa_findings.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pper bound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ms609-agent
ms609-agent requested a review from ms609 October 23, 2026 13:26
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.74%. Comparing base (0dd26a8) to head (0214785).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
- Coverage   97.74%   97.74%   -0.01%     
==========================================
  Files          60       60              
  Lines        6577     6575       -2     
==========================================
- Hits         6429     6427       -2     
  Misses        148      148              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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