Skip to content

Fix masked DiskGraph batches for high unsigned entity IDs (C-026) - #513

Merged
nittin-murthi merged 1 commit into
mainfrom
codex/c026-uint64-mask-ids
Nov 24, 2026
Merged

nittin-murthi merged 1 commit into
mainfrom
codex/c026-uint64-mask-ids

Conversation

@nittin-murthi

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

Copy link
Copy Markdown
Contributor

Fixes #496.

File-by-file change map

Masked batches failed before delivery when a valid unsigned entity ID exceeded the signed 64-bit range. The assembler now takes the low 32 bits used by the deterministic masking hash before constructing its tensor. The batch retains the full entity IDs.

Verification

Reused the C-026 regression from #447 with DiskGraph and native Parquet anchors. It checks the emitted IDs, mask tokens, and original labels. On main (2a3872ead), 2**63 - 1 passed and 2**63 and 2**64 - 1 failed. All three pass with this change.

The special-token and masking modules passed 42 tests locally. The CUDA parity test skipped on this CPU host. Ruff passed.

@copy-pr-bot

copy-pr-bot Bot commented Nov 23, 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 23, 2026 23:41 — with GitHub Actions Inactive
@nittin-murthi

Copy link
Copy Markdown
Contributor Author

Change map

The masking tensor overflowed for valid unsigned entity IDs above the signed 64-bit limit. C-026 covers both failing IDs and a signed-range control through the native Parquet-anchor batch API.

File Function / scope What changed Why
packages/experimental/kumo-pytorch/src/kumo/pytorch/assembly.py _mask_tokens Reduce integer masking keys to their low 32 bits before creating the tensor. The masking hash already uses these bits. This preserves its existing decisions and lets high unsigned IDs reach the batch.
packages/experimental/kumo-pytorch/tests/test_special_token_ids.py Masked contract fixture and C-026 regression Reuse the existing fixture for an unsigned primary key. Check native delivery, full entity IDs, positional sample IDs, mask tokens and original labels. Exercises the signed limit and both failing unsigned IDs through the package API.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

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

The masking code now constrains integer and boolean entity IDs to their low 32 bits before hashing. Tests cover native-anchor delivery for IDs at the signed 64-bit boundary and at the maximum unsigned 64-bit value. They check that IDs, masked values, target flags, and vocabulary values are preserved.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 0200a

This change lets masked batches be built for entity IDs above the signed 64-bit range, and the added tests cover those boundary IDs. No merge-blocking risk was identified.

Security architecture risk: Minimal · up to 0200a

Masked batches can now be delivered for valid unsigned entity IDs above the signed 64-bit limit. The fix preserves the full IDs in the batch and leaves masking decisions unchanged for IDs that already worked.

Pre-merge checks: Passed 2 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Change Map Design Review Inconclusive The check reviews the PR conversation comment that begins with <!-- kumo-pr-change-map -->. That comment is not available to this run. The checkout contains only the marker text in `docs/development… Provide the body of the PR conversation comment that begins with <!-- kumo-pr-change-map -->. The PR description links it at #513 (comment). Re-run this check with that text availabl…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR changes 2 files, below the threshold of 40. The changed-file inventory from git diff --name-status refs/coderabbit/pre-merge-check/base refs/coderabbit/pre-merge-check/head lists two modified…
Public Resource Access Passed The check applies only to external resource references (URLs, repository locations, package source locations) that this PR adds or modifies. The reviewed range changes two files: `packages/experimenta…
Full details: Pr Size

Explanation

The PR changes 2 files, below the threshold of 40. The changed-file inventory from git diff --name-status refs/coderabbit/pre-merge-check/base refs/coderabbit/pre-merge-check/head lists two modified files and no additions, deletions, or renames: - packages/experimental/kumo-pytorch/src/kumo/pytorch/assembly.py (M) - packages/experimental/kumo-pytorch/tests/test_special_token_ids.py (M) The check fails only when the file count exceeds 40. Line counts are ignored, as the check requires. Primary PR: NVIDIA/kumo-engine #513, author login nittin-murthi.

Full details: Public Resource Access

Explanation

The check applies only to external resource references (URLs, repository locations, package source locations) that this PR adds or modifies. The reviewed range changes two files: packages/experimental/kumo-pytorch/src/kumo/pytorch/assembly.py and packages/experimental/kumo-pytorch/tests/test_special_token_ids.py. I scanned every added and removed line in the diff for URLs, git or registry sources, package indexes, and cloud storage paths. None matched. The added code only introduces a bitmask (&amp; 0xFFFF_FFFF) and new imports from in-repo modules (conformance.assertions, kumo.pytorch.engines.native_anchors), plus a parameterized test. These are local code references, not external resources. The PR description links to GitHub issue, PR, and commit pages. Those links sit in the PR body, not in the changed repository content, so they fall outside the diff-based scope of this check. No added or modified external resource reference was found, so the check passes.

Full details: Change Map Design Review

Explanation

The check reviews the PR conversation comment that begins with &lt;!-- kumo-pr-change-map --&gt;. That comment is not available to this run. The checkout contains only the marker text in docs/development/review.md, which describes the convention and does not contain the comment's Change map. The PR description links to the comment at https://github.com/NVIDIA/kumo-engine/pull/513#issuecomment-7117255878, but this run has no provider comment-retrieval tool. The review-thread section also returned no threads, and an issue comment is not a review thread. Without the Change map, I cannot judge whether each change is necessary, whether it sits at the right layer, or whether its explanation is accurate. I did not assess the comment's content. Code evidence gathered for the reviewer's use (not a verdict on the table): - The committed diff changes _mask_tokens in assembly.py (lines 1257-1265). The int and bool branch becomes int(value) &amp; 0xFFFF_FFFF. Non-integer IDs still use the first four bytes of SHA-256. - The diff also adds a parameterized test in test_special_token_ids.py. It covers unsigned IDs at and above 2**63. - Design points a reviewer should check in the comment: - Masking now keys on the low 32 bits. Two distinct entity IDs that share those bits get the same masking key. The comment should say whether this collision is acceptable for deterministic masking. - For negative integer IDs, the mask changes the packed value (for example, -1 becomes 4294967295). The comment should say whether negative IDs can reach this path and whether that is intended. - The fix touches only the masking key. The comment should show that the batch still carries the full IDs, as the PR description says.

Resolution

Provide the body of the PR conversation comment that begins with &lt;!-- kumo-pr-change-map --&gt;. The PR description links it at #513 (comment). Re-run this check with that text available. The comment should state the observed failure (#496), the inspected existing behavior of _mask_tokens, the smallest sufficient change, the focused verification, and the stopping condition. Also address the 32-bit masking-key collision and the negative-integer behavior noted above.

  • 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 2a3872e and 0200afa.

Files selected for processing: 2

  • packages/experimental/kumo-pytorch/src/kumo/pytorch/assembly.py
  • packages/experimental/kumo-pytorch/tests/test_special_token_ids.py

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

@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.

Reducing integer IDs to the masking hash’s existing low 32 bits avoids signed packing overflow while preserving original identities and labels. All 19 focused tests passed, including native uint64 boundary cases.

@nittin-murthi
nittin-murthi enabled auto-merge (squash) November 24, 2026 22:27
@nittin-murthi
nittin-murthi merged commit 4f180a1 into main Nov 24, 2026
123 checks passed
@nittin-murthi
nittin-murthi deleted the codex/c026-uint64-mask-ids branch November 24, 2026 22:44

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 0200afa1 Deployed Nov 23, 2026 by nittin-murthi via import #3149
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.

DiskGraph cannot build a masked batch with large unsigned entity IDs

3 participants