Skip to content

Feature-substrate Python boundary + reproducibility demo - #29

Merged
logannye merged 4 commits into
mainfrom
rosalind/feature-substrate-demo
Jun 2, 2026
Merged

Feature-substrate Python boundary + reproducibility demo#29
logannye merged 4 commits into
mainfrom
rosalind/feature-substrate-demo

Conversation

@logannye

@logannye logannye commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to the feature substrate (PR #28): prove the pull — train a model on rosalind features output and show the inputs (and the trained model) are bit-reproducible, hash-verifiable.

  • python/rosalind.py — a dependency-light boundary (stdlib + numpy): features(index, alignments, ...) runs rosalind features and loads the per-locus table into numpy. Meets Python ML pipelines without a pyO3/pyarrow build.
  • examples/reproducible_features_demo.py (numpy-only) — builds a toy index+BAM, extracts features twice, proves byte-identical TSV + matching BLAKE3 receipts, trains a pure-numpy logistic regression on a genuine learnable task (is-purine from pileup counts), and shows the trained weights + predictions are bit-identical across the two extractions.

Verified locally (output in the findings doc): 983,011 loci, receipts match: True, held-out accuracy 0.9990, weights bit-identical: True, predictions bit-identical: True. The novel claim, demonstrated end-to-end: byte-identical features → bit-reproducible ML training inputs.

Spec: docs/superpowers/specs/2026-06-02-feature-substrate-demo-design.md. Findings: docs/findings/2026-06-02-reproducible-features-demo.md.

Honest notes

  • numpy-only by necessity: this environment has numpy but no pandas/scikit-learn/pyarrow/maturin, so a pyO3/pyarrow binding is not verifiable here. The demo + boundary are fully runnable + verified in-env; the headline is reproducibility (the is-purine task is deliberately simple but genuinely learnable).
  • Deferred (next step): the zero-copy pyarrow in-process binding (replacing the dead-end python_bindings stub) + an Arrow/Parquet egress — built and verified where maturin + pyarrow exist. This demo proves the pull before that investment.
  • No Rust changed; the Rust suite is unaffected.

Test plan

  • Demo runs end-to-end on the toy genome; output captured in the findings doc
  • python -c ast.parse on both modules; cargo fmt --check clean; cargo test green; 0 warnings

🤖 Generated with Claude Code

logannye and others added 4 commits June 2, 2026 11:03
…o spec (numpy-only)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…y-only)

python/rosalind.py: a dependency-light boundary (stdlib + numpy) that runs
"rosalind features" and loads the per-locus table into numpy — meets Python ML
pipelines without a pyO3/pyarrow build. examples/reproducible_features_demo.py:
builds a toy index+BAM, extracts features TWICE, proves byte-identical TSV +
matching BLAKE3 receipts, trains a pure-numpy logistic regression
(is-purine-from-counts, a genuine learnable task), and shows the trained weights
+ predictions are BIT-IDENTICAL across the two extractions. Verified locally:
983,011 loci, receipts match, held-out acc 0.999, weights/preds bit-identical.
The novel claim, demonstrated end-to-end: byte-identical features -> bit-
reproducible ML training inputs. (pyO3/pyarrow zero-copy binding + Arrow egress
are the next step — unverifiable in this env: no maturin/pyarrow.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…substrate

Records the demo's actual output (983k loci, matching receipt BLAKE3, held-out
accuracy 0.999, bit-identical weights/predictions across two extractions) +
points the README feature-substrate section at python/rosalind.py and the demo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@logannye
logannye merged commit 79faa39 into main Jun 2, 2026
2 of 3 checks passed
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