Skip to content

Fit materialized aggregate features and labels from selected anchor statistics - #328

Merged
Victsm merged 5 commits into
codex/timestamp-precision-20261112from
codex/materialized-statistics-20261113
Nov 13, 2026
Merged

Victsm merged 5 commits into
codex/timestamp-precision-20261112from
codex/materialized-statistics-20261113

Conversation

@Victsm

@Victsm Victsm commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Automatically fit scalar aggregate features and labels from statistics of the selected training anchors. Plan.materialize() streams their prepared values to Parquet and reuses DiskGraph's column collectors and the existing encoder fitter; fitting no longer retrieves histories to collect these values. Graph-field statistics keep their separate global-cutoff contract.

Depends on #310/#332 and the merged encoder-fitting work (#306/#307/#324). Native length planning is a separate child PR.

Validation: 55 focused materialization, fitting, type and native-batch tests pass with a rebuilt native module; Python lint and formatting pass. Ten typed-label/generated-boolean regressions fail before the repair and pass afterward. Coverage includes exact training-split membership, null/standard-deviation conventions, shared t-digest bucket accuracy, target-only fitting, reopen and no history collection.

Statistics use bounded Parquet batches and existing collectors. Vocabulary/category state retains the collector's existing cardinality behavior; this does not claim constant memory for unlimited distinct values. Text fitting remains the encoder-fitting path, not a new aggregate-text fitter.

Earlier combined-source loader validation on a transaction-history graph: 192,000 distinct anchors / 1,500 batches in each of two epochs; preparation 7.25s, iteration plus model-batch adaptation 35.18s then 31.75s. Native cache work changes from 192,000 computed / 0 reused to 0 computed / 192,000 reused. This is loader validation, not a new GPU-training speedup claim.

Change map

#328 (comment)

Review fixes: reuse the graph-materialization dtype mapping (including decimal metadata), use #306's bucket statistics without an exact-quantile rescan, and store one column-statistics payload referenced by lightweight metadata.

CI loading-parity repair: fit once and compare Parquet/request loading with the same frozen fitted state. Independently fitting the shared t-digest and legacy row recipes can legitimately yield different bucket boundaries. All tensor, label and held-out assertions remain; independent shared-statistics accuracy/selection regressions remain. After rebasing on #310/#332, 54 focused tests pass.

Latest review repairs: reuse target-free fitted inputs without a new fit split or statistics scan; omit temporary task-values paths from saved provenance; remove the redundant fitted-state equality from the loading parity test and document/independently test both bucket-fitting recipes. Local verification: 37 materialization/loading and 121 persistence/anchor-table tests pass; both new behavior regressions fail on the previous source.

@copy-pr-bot

copy-pr-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Victsm
Victsm temporarily deployed to gha-kumo-workflow-tests November 13, 2026 11:41 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 2 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Change Map Design Review Warning (previously flagged, unaddressed) The change map comment (<!-- kumo-pr-change-map -->) was not available in this run. The repository contains no copy of it, and the tools cannot read PR comments. I checked its claims against code at… Correct the change map before acceptance: 1. In the lib.rs and bp_col_stats.rs rows, state that validate_stats_dtype now accepts Date, Decimal128 and Decimal256 for all shared Parquet collector callers, including existing BP statistic…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed PR size check passes. PR NVIDIA/kumo-engine #328 changes 12 files against its actual base, below the limit of 40. Base and count: - The provider-reported PR record gives base ref `codex/timest…
Public Resource Access Passed The check passes because this PR adds or changes no external resource reference that needs verification. Scope: I diffed the PR against its merge base (7e8f109) and reviewed the 83 changed files. The …
Full details: Pr Size

Explanation

PR size check passes. PR NVIDIA/kumo-engine #328 changes 12 files against its actual base, below the limit of 40. Base and count: - The provider-reported PR record gives base ref codex/timestamp-precision-20261112 at c1b766ba1a835cfa9b8a620853adf97b5a296c93. Head is e3061d05c704698a8907e80febeb4b2918486880. - The provider's changed_files field is 12 (814 insertions, 52 deletions). - A local git diff --name-only c1b766ba... e3061d05... returns the same 12 files, with the same shortstat. Why the earlier FAIL does not apply: - The earlier run compared against origin/main, which does not contain #310 or #332. That diff picked up 83 files from the stacked dependencies. - The PR does not diff against origin/main. Those extra files are not part of #328. - The PR head also changed since the earlier run (6cf2390 to e3061d0). Files changed (12): - packages/diskgraph/diskgraph-pybind/python/diskgraph/__init__.py - packages/diskgraph/diskgraph-pybind/src/bp_col_stats.rs - packages/diskgraph/diskgraph-pybind/src/cutoff_col_stats.rs - packages/diskgraph/diskgraph-pybind/src/lib.rs - packages/experimental/kumo-pytorch/docs/03-encodings-and-ids.md - packages/experimental/kumo-pytorch/src/kumo/pytorch/aggregate_materialization.py - packages/experimental/kumo-pytorch/src/kumo/pytorch/assembly.py - packages/experimental/kumo-pytorch/src/kumo/pytorch/column_stats.py - packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py - packages/experimental/kumo-pytorch/src/kumo/pytorch/preparation.py - packages/experimental/kumo-pytorch/tests/test_diskgraph_backend.py - packages/experimental/kumo-pytorch/tests/test_materialized_feature_stats.py Caveat: The provider API was reached without authentication. The base ref and changed-file count come from that response, and the local diff confirms the count. Prior failure refuted: The prior FAIL counted 83 files by diffing against origin/main, which lacks the unmerged #310/#332 work. The provider-reported PR base is c1b766b (codex/timestamp-precision-20261112), and the PR head is now e3061d0. git diff c1b766b e3061d0 lists 12 files (814+/52-), and the provider changed_files is 12. That is below the threshold of 40.

Full details: Public Resource Access

Explanation

The check passes because this PR adds or changes no external resource reference that needs verification. Scope: I diffed the PR against its merge base (7e8f109) and reviewed the 83 changed files. The provider-reported PR author is Victsm. Evidence: - No added line contains an http(s), git+, ssh, git@, s3, or gs URL. A second search for GitHub, GitLab, Bitbucket, PyPI, crates.io, Hugging Face, docs.rs, and readthedocs hosts also found nothing. - The only manifest change is packages/diskgraph/diskgraph-train-table/Cargo.toml. It adds diskgraph-engine = { path = "../diskgraph-engine" }, which is a local path dependency. It also adds arrow = "60.1.0" and regex = "1". These are plain version requirements with no explicit registry or git source. They resolve from the default public crates.io registry, and the Cargo.lock diff adds no source lines. - packages/diskgraph/third_party/artifact-manifest.json changes only the cargo_lock_sha256 hash value. It adds no location. - The added Markdown in diskgraph-pybind/README.md and the kumo-pytorch docs contains no links. Limitation: I did not test anonymous access to crates.io, because the sandbox has no network access. This does not change the result. The added version requirements do not contain a location, and the default public registry is not a reference the PR introduces.

Full details: Change Map Design Review

Explanation

The change map comment (&lt;!-- kumo-pr-change-map --&gt;) was not available in this run. The repository contains no copy of it, and the tools cannot read PR comments. I checked its claims against code at head cd9a0fd (base 7e8f109). The code confirms the concerns from the prior failure, so they remain unresolved. Verified in code: 1. BP-path behavior change not disclosed. In packages/diskgraph/diskgraph-pybind/src/bp_col_stats.rs, validate_stats_dtype (lines 405-435) now accepts IngestedType::Date, Decimal128 and Decimal256. Added in this PR (diff against base). accumulate_parquet_col_stats (line 1278) calls this validator for every column. It has three call sites in the module (lines 1457, 1790, 1930). The shared collector therefore accepts these types for existing BP statistics callers, not only the new stat_sets path. Any map row that says BP callers are unchanged is wrong. 2. Second statistics copy and native pass not disclosed. aggregate_materialization.py writes statistic columns to temporary/stats through TaskParquetWriter (lines 264, 311-317). It then calls diskgraph.write_column_stats_for_parquet on those parts (lines 391-400). A map that says only "stream selected scalar columns through shared collectors" omits this cost and this second pass. 3. Misattributed pinning row. Target-only pinning happens in preparation.py _pinned_from_stats (lines 346-356, 402-467). assembly.py only merges pinned into input_state (lines 2627-2630). A map that assigns pinning to assembly.py is misattributed. 4. History-fetch boundaries not stated. History-free fitting covers only pinned scalar encoders. Graph-field fitting still calls source.fit_graph_fields (assembly.py line 752). Matching-group targets and aligned-event derived targets without a threshold also read values. The map must name these. 5. Missing check elements. The map must open with the observed failure (history retrieval during fitting), the inspected existing behavior, and the stopping condition. The measured evidence sits only in the PR description. 6. Unverified test claims. The "55 tests" and "10 regressions" statements were not run in this review. They must be marked as author-reported. Fixes confirmed in code: the dtype mapping reuses _diskgraph_dtype (aggregate_materialization.py 253-257). Bucket cuts use the t-digest grid through _bucket_cuts in column_stats.py. feature-stats.json stores only a columns_file reference. Because the comment text could not be re-read, I cannot confirm that the map was corrected. The head is unchanged from the prior run (cd9a0fd). The concerns therefore stand.

Resolution

Correct the change map before acceptance: 1. In the lib.rs and bp_col_stats.rs rows, state that validate_stats_dtype now accepts Date, Decimal128 and Decimal256 for all shared Parquet collector callers, including existing BP statistics (accumulate_parquet_col_stats call sites at lines 1457, 1790, 1930). Add a BP-path regression, or restrict the new types to the stat_sets path. Remove any claim that existing BP callers are unchanged. 2. Disclose the temporary/stats Parquet copy and the second write_column_stats_for_parquet pass in aggregate_materialization.py (lines 264, 311-317, 391-400). Justify both against a single-pass design, or propose a single-pass design. 3. Move the target-only pinning description from the assembly.py row to the preparation.py _pinned_from_stats row. The assembly.py change only merges pinned into input_state. 4. State that history-free fitting applies only to pinned scalar encoders. Name the remaining history-reading paths: graph-field fitting (source.fit_graph_fields), matching-group targets, and aligned-event derived targets without a threshold. 5. Add an opening statement with the observed failure (history retrieval during fitting), the inspected existing behavior, and the stopping condition. Move or reference the measured evidence from the PR description. 6. Mark the "55 tests" and "10 regressions" statements as author-reported and unverified in this review.

Latest assessment: Change Map Design Review

Latest assessment: The latest assessment was inconclusive; the previous failure remains unresolved.

Latest explanation: The check reviews the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt;. That comment is not in the supplied context. The review comments section states that no review threads were returned. The PR description links the comment at #issuecomment-6851807540, but this run has no tool that reads PR comments. The repository search found only one reference to the marker, in docs/development/review.md line 10. That file describes the required comment. It does not contain the comment text. The current head is e3061d0. The prior run recorded head cd9a0fd, so the code moved after that run. The map text remains unverified. Without the map, I cannot assess its change rows, stopping condition, or omitted behavior. Missing evidence cannot establish PASS. The prior FAIL is not disposed of. Its claims concern the map text. I cannot confirm that the map was corrected. I did not re-verify the prior run's code claims in this run.

Latest resolution: Provide the full text of the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt; (comment 6851807540). Make it readable by this check. Then rerun the check. The rerun should verify these prior concerns against the current head: 1. The lib.rs and bp_col_stats.rs rows must state that validate_stats_dtype (bp_col_stats.rs ~405-435) now accepts Date, Decimal128 and Decimal256 for all shared Parquet collector callers. This includes the existing BP call sites (accumulate_parquet_col_stats call sites ~1457, 1790, 1930). Remove any claim that existing BP callers are unchanged, or restrict the new types to the stat_sets path, with a BP-path regression. 2. The map must disclose the temporary/stats Parquet copy and the second write_column_stats_for_parquet pass in aggregate_materialization.py. It must justify them against a single-pass design, or propose one. 3. Target-only pinning belongs in the preparation.py _pinned_from_stats row. The assembly.py row only merges pinned into input_state. 4. The map must state that history-free fitting applies only to pinned scalar encoders. It must name the remaining history-reading paths: source.fit_graph_fields (assembly.py), matching-group targets, and aligned-event derived targets without a threshold. 5. The map must open with the observed failure (history retrieval during fitting), the inspected existing behavior, and the stopping condition. It should reference the measured evidence in the PR description. 6. The "55 tests" and "10 regressions" claims must be marked as author-reported and unverified in this review.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Victsm

Victsm commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

Change map

File Function / scope What changed Why
packages/diskgraph/diskgraph-pybind/python/diskgraph/__init__.py native exports Export the selected-Parquet statistics writer Make the shared native collector available to task preparation
packages/diskgraph/diskgraph-pybind/src/bp_col_stats.rs ColStatsOptions; shared Parquet collectors Allow selected statistic sets, enable existing date/decimal readers, and publish the standard column-statistics schema Reuse existing native collectors rather than introduce a second fitter
packages/diskgraph/diskgraph-pybind/src/cutoff_col_stats.rs write_column_stats_for_parquet / register Expose selected-Parquet statistics using existing publication logic Compute task-specific train-population statistics separately from graph cutoffs
packages/diskgraph/diskgraph-pybind/src/lib.rs compute_col_stats options Supply the optional statistic-set default Preserve existing BP statistics callers
packages/experimental/kumo-pytorch/src/kumo/pytorch/aggregate_materialization.py MaterializedValues; materialize_values; _ValuesSource Stream selected scalar columns through shared collectors with the existing dtype mapper; publish one statistics payload Fit aggregate inputs and labels without histories or population-sized sample lists
packages/experimental/kumo-pytorch/src/kumo/pytorch/assembly.py fit_plan / target-only pinned encoders Reuse selected label encoder statistics when input encoders are already fitted Avoid collecting target fitting values again
packages/experimental/kumo-pytorch/src/kumo/pytorch/column_stats.py ColumnStats; table_column_encoders; fit_from_stats Map materialized fields and targets into the unchanged #306 fitter, including its t-digest bucket cuts Keep training membership and existing encoder semantics
packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py _MaterializedDiskGraphSource Delegate selected task-column statistics to the bound values source Combine graph and task statistics without changing their selection rules
packages/experimental/kumo-pytorch/src/kumo/pytorch/preparation.py Plan.materialize / _pinned_from_stats / _materialize_values Compute selected-anchor statistics and pin shared encoders during preparation Keep feature and label fitting out of epoch loading
packages/experimental/kumo-pytorch/tests/test_materialized_feature_stats.py selected statistics regressions Check split membership, shared bucket rank accuracy, typed labels, generated boolean targets, single statistics payload, nulls and sample-free fitting Preserve fitted values and prove histories are not fetched
packages/experimental/kumo-pytorch/tests/test_diskgraph_backend.py Parquet/request loading parity Fit once and give both loading paths the same frozen state; retain all fitted-state, tensor, label and held-out assertions The shared t-digest fitter and legacy row fitter need not produce identical bucket boundaries
packages/experimental/kumo-pytorch/docs/03-encodings-and-ids.md Learned bucket contract Document t-digest materialized fits versus raw-row request fits and frozen-state reuse Independent cuts need not be identical

CI integration repair (2026-11-13): generated materialized labels remain internal metadata and are projected into native batches; GraphRoot fitting retains its cutoff converter; the statistics helper precedes the test module. New learned-encoder regressions fail before the fix and pass afterward. Existing public supplied/generated-label conflict validation is unchanged.

Review-fix verification: 55 focused materialization/fitting/type tests pass, including 10 dtype/generated-boolean cases that fail before the repair. Buckets now follow #306's t-digest contract (the test checks the same rank bound), without a second exact scan or decimal cast. feature-stats.json contains selection metadata and a reference to encoder-statistics/col_stats.json; it does not duplicate column vocabularies. Stop at the verified type, selection, reopen and shared-statistics behavior.

CI loading-parity repair: the failing test mixed two concerns: loading parity and exact equality of independently fitted approximate/exact bucket cuts. It now compares loading with the same frozen fitted state. The independent selected-population and shared t-digest rank-accuracy regressions remain. Local focused materialization and loading suite: 35 passed. No product behavior or quantile expectations were changed for this test repair.

Rebased verification including #332: 54 materialization, loading and token-count metadata regressions pass.

Priority review repair: target-free input-state reuse does not select a fit split or collect new statistics when nothing needs fitting. MaterializedValues no longer inserts task-local absolute filenames in FitRecord; the existing relative graph-statistics references remain. Saved artifacts retain the fit split and source fingerprints after task cleanup. The tautological fitted-state equality was removed from the loading-parity test, while actual tensor/label/held-out assertions remain; independent raw-row and materialized bucket fits both get accuracy checks.

Verification: both new reuse/provenance tests fail on the previous source and pass with this repair; 37 focused materialization/loading and 121 reuse/persistence/anchor-table tests pass. No exact-quantile rescan or new provenance subsystem.

@Victsm
Victsm force-pushed the codex/timestamp-precision-20261112 branch from 11b461a to 20b87cc Compare November 13, 2026 15:50
@Victsm
Victsm force-pushed the codex/materialized-statistics-20261113 branch from ced3e01 to 33511dd Compare November 13, 2026 15:50
@Victsm
Victsm had a problem deploying to gha-kumo-workflow-tests November 13, 2026 15:50 — with GitHub Actions Error
@Victsm
Victsm temporarily deployed to gha-kumo-workflow-tests November 13, 2026 15:50 — with GitHub Actions Inactive
Victsm added a commit that referenced this pull request Nov 13, 2026
Prepare declared scalar features and generated scalar targets
automatically inside `Plan.materialize()`. Computation streams bounded
anchor chunks into managed task artifacts; model iteration reads the
prepared values. Generated labels remain internal metadata, rather than
becoming caller-supplied targets during encoder fitting. The extra
public precompute orchestration was removed.

Stack: #279 → #280 → #281 → #282 → #283 → #310. Selected aggregate/label
encoder statistics and native length planning are now published
separately as #328/#329, after the merged encoder-fitting work.

Validation: the combined repaired stack passes168 focused package
regressions,109 clock/fitting/materialization checks, all three
unchanged example notebooks and strict all-target native Clippy. Four
new learned-encoder cases fail before the internal-target repair and
pass afterward; target tensor parity and genuine
supplied/generated-label conflict rejection are retained. Earlier
source-bound native/aggregation benchmark evidence is retained
separately; no new GPU speedup is claimed here.

## Change map

#283 (comment)

---------

Co-authored-by: Min Shen <[email protected]>
@Vedaant-J

Copy link
Copy Markdown
Contributor

wrong DiskGraph dtype names (aggregate_materialization.py:251-263). It sends "boolean", "uint64", "date32" and timestamp unit "s", but DiskGraph expects bool, u_int64, date and
seconds. So on DiskGraph, Plan.materialize fails for any bool, uint, date or timestamp column with a fitted encoder. Examples:
- a supplied bool label with Vocabulary fails with unknown variant boolean (on #310 it fits);
- a timestamp max aggregate with Vocabulary fails with unknown variant s;
- generated Compare targets, which are always bool, fail too.

A second Buckets contract:

Statistics output left in the published values directory. Each one ships col_stats.json plus a duplicate feature-stats.json. A Vocabulary column near the 1M cap carries about a
million entries in each file.

@Victsm
Victsm temporarily deployed to gha-kumo-workflow-tests November 13, 2026 18:38 — with GitHub Actions Inactive
@Victsm

Victsm commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed in cd9a0fd:

Local verification: 55 focused tests pass with a rebuilt native module, including 10 dtype/generated-boolean regressions that fail before this fix. Bucket tests now check the shared rank-accuracy contract and forbid the second exact-quantile pass. Lint/format checks pass.

@Victsm
Victsm force-pushed the codex/materialized-statistics-20261113 branch from cd9a0fd to db48688 Compare November 13, 2026 21:11
@Victsm
Victsm had a problem deploying to gha-kumo-workflow-tests November 13, 2026 21:11 — with GitHub Actions Error
@Victsm

Victsm commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 6cf23900 on the updated #310/#332 parents; 54 focused tests pass.

The CI parity test now compares Parquet/request loading with one frozen fitted state, retaining tensor, label and held-out comparisons. It previously compared independently fitted shared t-digest and legacy exact-row bucket boundaries. The separate selected-statistics/rank-accuracy tests remain, and no exact-quantile rescan was restored.

@Vedaant-J

Copy link
Copy Markdown
Contributor

the parity test can't fail any more. It now reuses one fitted state for both entry points, so its equality check is always true. Fitted independently, a Parquet anchor table and a request list give different Buckets cuts for the same data: (5.0, 7.5) against (6.0, 7.0). That's within #306's contract, but undocumented.

@Vedaant-J

Copy link
Copy Markdown
Contributor

plan.materialize(anchors, fitted=task.fitted_state.inputs) on a contract with no targets, where the anchors declare splits, still raises "fitting needs to be told which to read", although nothing will be fitted. kumo-pytorch does not seem to enforce targets needing to be there probably for unsupervised, self-supervised learning so needs to be handled

@Vedaant-J

Copy link
Copy Markdown
Contributor

The fit record is saved inside the model artifact (artifact.py). It's the provenance of the fitted encoders: which anchors (fit_split) and which statistics files they were fitted from. The existing entries are file names relative to /col_stats/, and those files stay there.

#328 adds two absolute paths into /tasks/task-XXXX/values/, which is a temporary directory deleted when the task closes. So let's remove the temp paths from the provenance file?

@Victsm
Victsm temporarily deployed to gha-kumo-workflow-tests November 13, 2026 22:18 — with GitHub Actions Inactive
@Victsm

Victsm commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed in e3061d05:

  • Target-free fitted-input reuse no longer requests a fit split or collects new encoder statistics.
  • Saved provenance omits task-temporary statistics paths; stable graph references remain, and artifact reload is checked after task cleanup.
  • Removed the tautological fitted-state equality. Actual loading/tensor/label parity remains; independent raw-row/materialized bucket fits are checked separately, and their approximation difference is documented. No exact-quantile rescan was restored.

Both new behavior regressions fail on the previous source. Verification: 37 focused materialization/loading and 121 persistence/anchor-table tests pass.

@Victsm
Victsm merged commit 88a27b0 into codex/timestamp-precision-20261112 Nov 13, 2026
109 checks passed
@Victsm
Victsm deleted the codex/materialized-statistics-20261113 branch November 13, 2026 23:33
Victsm added a commit that referenced this pull request Nov 13, 2026
…ths (#329)

Move length-aware sequence batch planning into the native AnchorTable
iterator. It shuffles anchors into bounded pools, uses fitted field
costs and optional text-token metadata to form history/token-budget
batches, and caches each anchor's measured lengths for later epochs. The
loading loop keeps the existing combined graph/anchor reader and native
capped cross-component history merge.

Depends on #328 (its parent), #310 and #332; encoder fitting
#306/#307/#324 is merged. The history length query is prepared once when
the iterator is attached; planning does not invoke encoders or
reconstruct Python per-anchor requests. Fixed-width inputs need only a
constant field cost, not a per-row token file.

Validation: the combined rebased stack passed 2,220 package tests (3
skipped, 47 deselected). After the parent’s final fetched-timestamp
repair, 180 focused clock/materialization/loading/planning/counting
tests pass; the Rust tree is unchanged. Tests compare delivered tensors,
verify shuffle/coverage/caps/padding/token budgets, and prove epoch-two
cache reuse without planning-time encoding. Ruff passes.

Limits: length planning currently requires a supported EventSource and
Packed/Padded/Nested layout. Unsupported derived-field validity recipes
are rejected explicitly. Existing refusal of distributed variable-token
schedules is preserved. The task-owned sparse mapped cache uses 4–12
bytes per anchor and is not a persistent cross-task cache.
`length_input` remains the cost-metadata gate; tokenized length
bucketing can need token counts without `max_tokens`.

Earlier combined-source loader validation on a transaction-history
graph: 192,000 distinct anchors / 1,500 batches in each of two epochs;
preparation 7.25s, iteration plus model-batch adaptation 35.18s then
31.75s. Native cache work changes from 192,000 computed / 0 reused to 0
computed / 192,000 reused. This is loader validation, not a new
GPU-training speedup claim.

## Change map

#329 (comment)

Bucketing review fix: sort by the cached model-input length (tokens for
token layouts, events for row layouts). Four regressions compare
flat/nested batch ordering and delivered tensors with the existing
planner and verify cache reuse; all fail before the fix. #332 supplies
empty-value/required-field counts and policy-keyed files. Native
planning consumes its dropped-row marker and updated saturation limit,
and rejects stale count recipes. New regressions cover the reported
empty-text budget overflow and required-field drops, including
second-epoch cache reuse.



Latest review repair: row inputs without max_tokens sort by the history
count actually stored in the compact one-field cache. Two regressions
compare Packed/Padded ordering, delivered tensors and epoch-two reuse
while retaining four bytes per anchor. Other native length_input sources
remain explicitly refused; documentation and two EntitySource cases make
that decision visible. Local verification: 86 combined tests and all 26
documentation checks pass with a rebuilt native module.

---------

Co-authored-by: Min Shen <[email protected]>
@Victsm

Victsm commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

The side-branch integration has been removed from #310. The independent main-targeted replacement is #338; this original merge did not land on main.

Victsm added a commit that referenced this pull request Nov 14, 2026
…tatistics (#338)

Fit prepared scalar features and labels from statistics of the selected
training anchors, reusing DiskGraph's column collectors and the existing
encoder fitter. Eligible statistics-based fitting does not retrieve
event histories; statistics remain bounded by Parquet batches, with
existing vocabulary-cardinality limits. Supplied fitted inputs on
target-free anchors need no new fit split or statistics scan.

Replaces #328 and targets main directly. There is no #310 or
native-planning dependency. The reviewed implementation was replayed
onto main, then the focused review repairs described below were applied.
Its timestamp statistics matrix covers main's currently supported
seconds unit; the additional subsecond cases belong with #310's
timestamp capability. No existing product assertion was weakened.

Validation: 2,102 package tests passed independently on current main (3
skipped, 47 deselected), including documentation/API checks, with a
rebuilt matching native module. Ruff and whitespace checks passed.
Coverage includes split selection, scalar types, null/stddev/bucket
semantics, saved provenance, reopen, fitted reuse and avoiding history
collection.

## Change map

#338 (comment)

Review repairs preserve the existing sample-fitting fallback for custom
sources without graph statistics and for computed scalar encoders
needing Tokens(skip_event) row eligibility. Selected statistics remain
available for eligible encoders. Three regressions fail before the
repair and pass afterward; the combined three-PR integration passes
2,313 package tests.

---------

Co-authored-by: Min Shen <[email protected]>
Victsm added a commit that referenced this pull request Nov 14, 2026
…ths (#339)

Plan length-aware sequence batches in the native AnchorTable iterator.
Shuffle anchors into bounded pools, consume fitted constant/text-token
metadata, form layout-aware batches and cache per-anchor lengths for
later epochs. The history plan is prepared once; planning neither
reconstructs Python requests nor re-encodes anchor histories. Frozen
text constants are counted once when attaching the iterator.

Replaces #329 and targets main directly, with no #310 or #328
dependency. The reviewed patch was replayed onto current main, followed
by the focused review fixes below. Existing encoder fitting/counting
support is already merged. Native planning supports history EventSource
inputs with Packed/Padded/Nested layouts; other sources and distributed
variable-token budgets remain explicitly refused. The sparse task-owned
cache uses 4–12 bytes per anchor.

Validation: 2,122 package tests passed independently on current main (3
skipped, 47 deselected), including documentation/API checks, using a
rebuilt matching native module. Ruff and whitespace checks passed.
Regressions verify actual tensors, shuffled coverage, row/token
bucketing, caps, budgets, required-field/empty-text counting and
epoch-two cache reuse. No new training-speedup claim.

Review fixes in `8824ef1e`: scope planning to its designated history
merge; preserve restored states with absent input provenance; count
constant-only same-table components independently; release mapped token
metadata on close; skip example optimizer updates without supervision.
Five added regression cases fail before these fixes and pass afterward.
The padded-event-budget claim was checked against real output tensors:
nested events use a separate index map, not a dense padded token cube.

## Change map

#339 (comment)

---------

Co-authored-by: Min Shen <[email protected]>
Victsm added a commit that referenced this pull request Nov 14, 2026
…ry batches (#310)

Preserve declared timestamp precision through aggregation, fitting,
anchors, graph features and native history batches, including exact
nanoseconds without pandas. Cutoffs retain causal-floor semantics; plain
integer anchors remain epoch seconds, while integer field/label values
use their declared timestamp ticks. Mixed query units and overflow are
refused.

This PR contains only timestamp support. Materialized statistics and
native planning now target main independently in #338 and #339; neither
depends on this PR. #332 and the earlier
aggregation/history/anchor/fitting changes are already in main.

The graph-output repair normalizes timestamp columns to their declared
type through the existing typed-array conversion before encoding. Six of
eight signed timestamp / request-versus-native-anchor cases failed
before the repair; all eight pass afterward. The eager TimestampScalar
repr concern did not reproduce without pandas on Arrow 15 or 24, so no
speculative change was added.

Validation: 291 focused clock/graph/regression checks pass on this
branch, including 177 clock cases. The complete package suite passes
2,310 checks on the combined integration of this PR with independently
based #338/#339 (3 skipped, 47 deselected), using an identical verified
native subtree. This includes the four-unit end-to-end feature/label
fitting lifecycle. Ruff, whitespace and all three published change maps
pass.

The old #328/#329 side-branch merges have been removed from this branch.
Their runtime changes now target main independently through #338/#339
and will be separate main commits.

Deferred by user: ingestion normalization/window membership, general
fitting redesign and key/IPC performance. No ingestion rewrite, tighter
input admission or new performance claim was added.

## Change map

#310 (comment)

---------

Co-authored-by: Min Shen <[email protected]>
Co-authored-by: Vedaant Jain <[email protected]>
Co-authored-by: Claude <[email protected]>

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — e3061d05 Deployed Nov 13, 2026 by Victsm via import #2332
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.

2 participants