fix: reuse the producer snapshot for the final write - #161
Merged
Merged
Conversation
SkyeAv
added this pull request to stack #162
September 15, 2026 17:37
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SkyeAv
force-pushed
the
runcache/producer-reuse
branch
from
September 15, 2026 17:51
723f5a5 to
4d12327
Compare
SkyeAv
marked this pull request as ready for review
September 15, 2026 18:06
SkyeAv
force-pushed
the
runcache/producer-reuse
branch
from
September 15, 2026 18:25
4d12327 to
fa94cb7
Compare
Avoid evaluating a producer's lazy shared prefix twice. The snapshot callback may now return a replacement LazyFrame; compile_subgraph adopts it as the accumulator for the remaining producer tail. The build callback stores and reloads the ephemeral parquet snapshot, so the producer's final to_store and all consumers read the same materialized prefix. A missing reload raises the existing runcache-missing-snapshot error instead of silently falling back to the original lazy lineage. Added a lazy side-effect regression proving the guarded producer prefix is collected once, not once for the snapshot plus once for the producer write. Verified: full uv run pytest -q -> 1380 passed, 43 skipped; focused + impact suites -> 338 passed; Tier-2 review PASS; ruff check/format clean; pyright 0.
SkyeAv
force-pushed
the
runcache/producer-reuse
branch
from
September 15, 2026 18:36
fa94cb7 to
dae9c60
Compare
SkyeAv
added a commit
that referenced
this pull request
Sep 15, 2026
Cut 19.0.0 and bump the package version in pyproject.toml, CITATION.cff, and uv.lock. Major: five breaking changes ship. The `tablassert` console command now requires the optional `[cli]` extra, since `cyclopts` and `rich` left the base install (#187). Level-one normalization redefines fullmap keys as cleaned Unicode-lowercase, Porter2-normalized, byte-ordered token sets and moves the database to schema v6, so every schema-v5 fullmap is rejected and must be rebuilt (#171, #172, #174, #175, #176). `build-fullmap --aria2c` is gone -- aria2c is used automatically whenever the `[aria2]` extra is installed (#178) -- and `--taxon-allowlist` is gone because the built-in top-100 experimental-taxon allowlist now applies to every build, guarding both reuse paths by `META.taxon_allowlist` identity (#153). Logging now requires the `[log]` extra and is fully disabled without it (#152). Features: `tablassert.net` is a new stdlib-only transient/permanent classification and retry seam shared by the agent and the BABEL downloader (#163, #164), with one bounded jittered retry layer across the inner agent, reflexion, and judge (#167) and machine-readable `error_code` values on skipped checkpoint records (#166). `build-kg` gained an automatic ephemeral shared-prefix TCode cache keyed by content-addressed XXH64 op digests (#155-#159, #161). The `--distill` corpus became schema-uniform v2 with a sibling `outcomes.ndjson`, a deterministic `RewardConfig`-tunable reward, and the new zero-dependency `tablassert distill-weigh` command (#180-#183). `CLASS_FIELD_OVERRIDES` grants the DAKP sparse qualifier stack on the pinned association classes (#188). Fixes: `distill-export` partitions its corpus by content and unions the schema across record files, so a mixed v1/v2 directory no longer CastErrors or silently stringifies a column (#184); BABEL retry warnings survive the loguru sink; PMC downloads are idempotent, atomic, and bounded-parallel (#165); reflexion and judge prompts are hard-bounded (#168). Changelog: - versioned the Unreleased section as 19.0.0 - 2026-09-15 - merged three duplicate `### Added` blocks into one - moved the two `BREAKING:` entries from `### Changed` into `### Breaking Changes` and added a `**Migration:**` note to all five - added PR links to all 17 entries, which carried none - added the missing entries: the distill v2 corpus/reward/distill-weigh stack (#180-#183), the distill-export schema-drift fix (#184), the TCode run-cache detail (#155-#161), and the README badge removal (#154) Docs: none needed here. Every shipped doc change landed with its own PR, and the docs source-of-truth gate passes against the bumped tree. Testing: - make check -> exit 0 - uv run ruff check . -> All checks passed! - uv run pyright -> 0 errors, 0 warnings, 0 informations - uv run pytest -> 1622 passed, 52 skipped - cargo test --manifest-path rust/Cargo.toml -> 156 passed, 0 failed - cargo clippy --all-targets -- -D warnings -> clean - uv lock --check -> resolved 169 packages, lock current - uv run mkdocs build --strict -> exit 0 - docs SSOT + CLI coverage after the changelog edit -> 204 passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Layer 7 of 7 in the TCode run-cache stack (stack #162), a fix to the integration layer: the producer's final write no longer recomputes the lazy shared prefix. Storing the snapshot collected the lazy lineage once, then
to_storecollected it again — prefix work ran twice for the producer (masked in e2e counting becauseresolve_batcheagerly materializes).Fix
snapshotcallback may now return a replacementLazyFrame;compile_subgraphadopts it as the accumulator for the remaining producer tail. The build callback stores, then reloads the ephemeral parquet and hands that scan back, so the producer'sto_storeand every consumer read the same materialization.runcache-missing-snapshotinstead of silently continuing with the original lazy lineage.Testing
tests/test_run_cache.py::test_compile_subgraph_snapshot_replacement_avoids_producer_recompute.uv run pytest -q(full suite) → 1380 passed, 43 skipped--no-cov -n 0) → 338 passeduv run ruff check .→ passed;uv run ruff format --check .→ formatted;uv run pyright→ 0 errors; independent reviewer pass