Skip to content

Count emitted missing text constants in DiskGraph token budgets - #516

Merged
nittin-murthi merged 6 commits into
mainfrom
codex/499-missing-text-budget
Nov 25, 2026
Merged

nittin-murthi merged 6 commits into
mainfrom
codex/499-missing-text-budget

Conversation

@nittin-murthi

@nittin-murthi nittin-murthi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #499.

A masked training batch with a missing text constant used to fail as soon as a token budget was set. DiskGraph now counts the missing token with the same fitted encoder it uses for other text constants.

Change map

Testing

On main, one of the four cases from #447 failed. All four passed with the fix. The package regression also checks that a four-token budget rejects the five-token sample. The length-planning and target-layout modules passed all 85 tests.

@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 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.

@nittin-murthi
nittin-murthi temporarily deployed to gha-kumo-workflow-tests November 24, 2026 00:05 — with GitHub Actions Inactive
@nittin-murthi

nittin-murthi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Change map

File Function / scope What changed Why
packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/native_anchors.py NativeAnchors._length_contract Count a null text constant with the fitted encoder when the row emits missing tokens. A constant has no stored column to look up. Its token cost is known before reading the anchors.
packages/experimental/kumo-pytorch/tests/test_native_length_planning.py Native text-budget tests Share the existing text contract and run #447’s masked-label regression with Parquet anchors. Also check a budget one slot below the sample size. Verify the exact inputs, labels, validity and corruption mask, and catch an undercount.
packages/experimental/kumo-pytorch/tests/test_keyless_tables.py Keyless relation validation tests Construct DiskGraphEngine with its current API. The per-test scratch fixture supplies the isolated index location for both parameterized cases.
packages/experimental/kumo-pytorch/tests/test_diskgraph_unsupported.py Aliased text preflight test Use the managed DiskGraphEngine constructor and assert that its actual index path stays absent after preflight rejects a contract. The supported engine API allocates the index path under the test scratch root.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "tone_instructions" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

Native length planning now counts constant values when the row policy is emit, including null constants. Tests cover emitted constants with masked text targets under multiple token budgets, including an oversized-sample error. The next-token budget test uses a shared text-history contract helper. Relation-refusal and duplicate-field tests use the default DiskGraphEngine configuration.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 84514

The change makes token budgets count missing text constants, which fixes the first-batch failure when a budget is set. No remaining merge-blocking risk was found.

Security architecture risk: Minimal · up to 84514

DiskGraph now counts missing text tokens when it emits them. A sample can be rejected if its actual token count exceeds the configured limit. This corrects enforcement of the existing limit without changing access or storage behavior.

Pre-merge checks: Passed 2 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Change Map Design Review Inconclusive Summary: I could not read the PR conversation comment that starts with <!-- kumo-pr-change-map -->, so the check cannot be completed. The only text I had was the distilled "Comments summary" in the … Provide the exact text of the <!-- kumo-pr-change-map --> conversation comment (or make it readable in the review environment) and re-run this check. The re-check should confirm: - The map states the observed #499 failure and the verifica…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR size check fails only when the changed-file count exceeds 40. The exact reviewed range (refs/coderabbit/pre-merge-check/base to refs/coderabbit/pre-merge-check/head) changes 4 files, all modifi…
Public Resource Access Passed The check applies only to external resource references (URLs, repository locations, package sources) that this PR adds or modifies. The reviewed range changes four files: native_anchors.py, test_nativ…
Full details: Pr Size

Explanation

The PR size check fails only when the changed-file count exceeds 40. The exact reviewed range (refs/coderabbit/pre-merge-check/base to refs/coderabbit/pre-merge-check/head) changes 4 files, all modified (M), and none added, deleted, or renamed: - packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/native_anchors.py - packages/experimental/kumo-pytorch/tests/test_diskgraph_unsupported.py - packages/experimental/kumo-pytorch/tests/test_keyless_tables.py - packages/experimental/kumo-pytorch/tests/test_native_length_planning.py Four files is well below the threshold of 40. Line counts are ignored by this check.

Full details: Public Resource Access

Explanation

The check applies only to external resource references (URLs, repository locations, package sources) that this PR adds or modifies. The reviewed range changes four files: native_anchors.py, test_native_length_planning.py, test_keyless_tables.py, and test_diskgraph_unsupported.py. I scanned every added line in the diff for http(s) URLs, git+ or git@ references, github.com, PyPI/npm/registry hosts, cloud storage URIs, container registries, and .git locations. None matched. The added lines contain only Python code and a local temporary Parquet path (tmp_path), which is a local test fixture and is excluded. The PR description and linked issue contain URLs, but those are outside the diff and the check does not apply to them. No added or modified external resource reference exists, so the check passes.

Full details: Change Map Design Review

Explanation

Summary: I could not read the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt;, so the check cannot be completed. The only text I had was the distilled "Comments summary" in the PR objectives. That summary is a rewrite, not the comment. It does not show the observed failure, the inspected existing behavior, the verification, or the stopping condition in the comment's own words. Missing evidence cannot establish PASS. Design observations from the code (PR head vs. merge base; primary PR #516, author nittin-murthi): 1. Core fix (native_anchors.py line 687). A null text Constant now counts toward the fixed cost when row.missing == "emit". It uses the fitted encoder (binding.encode_values([value.value])). The change is at the right layer and matches the linked issue #499. Missing None values under omit are unchanged. I did not verify that Text.encode_values([None]) returns the intended missing-token count. That needs the encoder's None handling, which I did not inspect. 2. Test changes outside the #499 behavior. test_keyless_tables.py and test_diskgraph_unsupported.py replace DiskGraphEngine(index=...) with the managed-path constructor. The base constructor has no index parameter, so the base tests already fail with TypeError. These repairs are real but unrelated to #499. docs/development/review.md says to "keep unrelated improvements separate." The map must justify them as separate, or they should move to their own PR. Based on the distilled summary, the map does not clearly state this. 3. Weaker assertion. test_diskgraph_unsupported.py now checks not engine.index.exists() instead of the explicit tmp_path / "index" path. The managed index_dir path is not a test-owned path, so the assertion is less direct. This is an uncertain design question, not a proven defect. 4. Unverified claim. The distilled summary says the keyless test uses "a per-test scratch fixture." I found no def scratch in the touched test files or conftest.py. The isolation mechanism may exist under another name, but I did not confirm it. 5. New test coverage. test_native_text_budget_preserves_typed_constant_supervision covers "a" and None constants with budgets None, 12, and 4. The value_ids and valid assertions are identical for both constants. Only the label changes. This is consistent with the stated intent but is not proof of the fix.

Resolution

Provide the exact text of the &lt;!-- kumo-pr-change-map --&gt; conversation comment (or make it readable in the review environment) and re-run this check. The re-check should confirm: - The map states the observed #499 failure and the verification that shows it is fixed. - The map justifies, or moves to a separate PR, the DiskGraphEngine constructor migrations in test_keyless_tables.py and test_diskgraph_unsupported.py, which fix tests that already fail on the base branch. - The map names the isolation mechanism behind "per-test scratch fixture" and gives the reason for changing the tmp_path / "index" assertion. - The map states that Text.encode_values([None]) returns the intended missing-token cost under emit.

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

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 130bc2a and 8451491.

Files selected for processing: 2

  • packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/native_anchors.py
  • packages/experimental/kumo-pytorch/tests/test_diskgraph_unsupported.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 6 remain after this review.

Victsm
Victsm previously approved these changes Nov 24, 2026

@Victsm Victsm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native token planning now counts the missing text constant exactly when the row policy emits it, using the fitted encoder rather than another counting rule. All 59 native length-planning tests passed with text dependencies available.

…t-budget

# Conflicts:
#	packages/experimental/kumo-pytorch/tests/test_native_length_planning.py
@nittin-murthi
nittin-murthi temporarily deployed to gha-kumo-workflow-tests November 24, 2026 22:39 — with GitHub Actions Inactive
@nittin-murthi
nittin-murthi temporarily deployed to gha-kumo-workflow-tests November 24, 2026 22:56 — with GitHub Actions Inactive
@nittin-murthi
nittin-murthi temporarily deployed to gha-kumo-workflow-tests November 24, 2026 23:05 — with GitHub Actions Inactive
@nittin-murthi
nittin-murthi requested a review from Victsm November 24, 2026 23:24
@nittin-murthi
nittin-murthi merged commit 9eb51dc into main Nov 25, 2026
119 checks passed
@nittin-murthi
nittin-murthi deleted the codex/499-missing-text-budget branch November 25, 2026 00:00

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 84514910 Deployed Nov 24, 2026 by nittin-murthi via import #3250
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.

Adding a token budget breaks masked training on a missing text value

3 participants