Skip to content

Check special-token IDs after a DiskGraph reload in a new process - #362

Closed
anle2024 wants to merge 3 commits into
mainfrom
anle/kumo-pytorch-special-ids-fresh-process
Closed

anle2024 wants to merge 3 commits into
mainfrom
anle/kumo-pytorch-special-ids-fresh-process

Conversation

@anle2024

@anle2024 anle2024 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add _explicit_id_contract to tests/test_inference_lifecycle.py. It is the existing PRAGMA contract with gapped explicit special-token IDs: pad 0, unknown 1, missing 2, mask 10, entity 11 and event 12.
  • In CONTRACTS, it runs 4 existing lifecycle tests with explicit IDs: the reload in a child process on both engines, DiskGraph versus reference inference, serving versus batch inference, and inference from the input state alone. Each test compares the fitted state or the batches of the two sides.
  • tests/test_special_token_ids.py already checks the explicit numbering in one process.

Change map

File-by-file change map

Testing Done

  • python -m pytest -q --require-imports tests/test_inference_lifecycle.py tests/test_special_token_ids.py: 73 passed, including the 7 new explicit_ids cases. The run used a DiskGraph wheel built locally from main at eb474553 (Linux aarch64, Python 3.12, CPU torch 2.12.0).
  • A local check showed that the fitted roles of this contract equal the declared IDs.
  • ruff check and ruff format --check pass on the changed file.

Checklist

  • I listed all the breaking changes introduced by the PR: none.
  • I made sure to update examples and documentation with my changes (if necessary)
  • I added and modified the unit tests required to cover the changes in this PR.

🤖 Generated with Claude Code

The existing check reloads the artifact in the same process on the
in-memory engine. The new test trains on DiskGraph, loads the artifact
in a child interpreter, and infers over unseen rows on a new DiskGraph
index. It covers the blueprint and the gapped layouts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@anle2024

anle2024 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Change map

File Function / scope What changed Why
packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py _explicit_id_contract, CONTRACTS New PRAGMA contract with gapped explicit special-token IDs, added to CONTRACTS It runs the fresh-process reload on DiskGraph and 3 more lifecycle checks with explicit IDs. No test covered these.
  • Requirement: the explicit special-token ID mapping survives a reload in a new process on DiskGraph.
  • Existing behavior: explicit IDs had a check only in the same process on the in-memory engine.
  • Smallest change: one 5-line contract builder and one CONTRACTS entry.
  • Verification: 73 passed locally, including 7 explicit_ids cases.
  • Stopping condition: the 7 cases pass in kumo-pytorch-tests and kumo-pytorch-diskgraph on this PR.

@copy-pr-bot

copy-pr-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@anle2024
anle2024 temporarily deployed to gha-kumo-workflow-tests November 16, 2026 21:20 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The lifecycle tests add an explicit_ids contract. It derives from the PRAGMA contract and sets special-token IDs to pad=0, unknown=1, missing=2, mask=10, entity=11, and event=12. The contract map registers it alongside the existing temporal and PRAGMA contracts.

Merge Risk: Minimal · up to 93349

This change adds a test contract with explicit special-token IDs to the lifecycle tests. It does not alter production behavior, and no actionable merge-blocking risk is evident.

Security architecture risk: Minimal · up to d7235

The change expands test coverage without changing production behavior or introducing a security-relevant boundary or state transition.

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's text is not in the supplied context, and the checkout does not contain it. The marker appea… Provide the full text of the PR conversation comment that begins with <!-- kumo-pr-change-map --> (the comment linked as issuecomment-6929706145), or supply it as review context. With that text, re-run the check. The check should confirm …
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR size check counts changed files and fails only when the count exceeds 40. git diff --name-status refs/coderabbit/pre-merge-check/base refs/coderabbit/pre-merge-check/head lists one changed fi…
Public Resource Access Passed The check applies only to external resource references whose text this PR adds or modifies. The PR changes one file, packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py. The patch (…
Full details: Pr Size

Explanation

The PR size check counts changed files and fails only when the count exceeds 40. git diff --name-status refs/coderabbit/pre-merge-check/base refs/coderabbit/pre-merge-check/head lists one changed file: packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py (status M). The count is 1, which does not exceed 40. Line counts are ignored by the check. No failure condition applies.

Full details: Public Resource Access

Explanation

The check applies only to external resource references whose text this PR adds or modifies. The PR changes one file, packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py. The patch (+9/-0) adds _explicit_id_contract, a dict of special-token IDs, and a CONTRACTS entry "explicit_ids". A search of all added lines for http(s)://, git+, git@, github.com, pypi, index-url, find-links, file://, .whl, .tar and ssh:// found no matches. The PR description links to a PR comment and a DiskGraph wheel built from main. Those links are not in the changed repository files and are not added code references, so the check does not cover them. With no added or modified external resource reference, 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's text is not in the supplied context, and the checkout does not contain it. The marker appears only in docs/development/review.md, where it describes the process. No tool in this run reads PR conversation comments. The PR description links to the comment (issuecomment-6929706145), but the link alone does not supply its Change map table, problem statement, verification, or stopping condition. The objectives give only a paraphrase: the change map says explicit special-token IDs were previously checked only in one process on the in-memory engine, and it names kumo-pytorch-tests and kumo-pytorch-diskgraph as the stopping condition. That paraphrase is not the Change map itself, so I cannot assess its rows. Diff context, for reference only: the committed range changes one file, packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py, with 9 insertions and 0 deletions. This is test-only code. It adds _explicit_id_contract and registers it in CONTRACTS. I did not evaluate design necessity against the comment's claims because those claims are unavailable.

Resolution

Provide the full text of the PR conversation comment that begins with &lt;!-- kumo-pr-change-map --&gt; (the comment linked as issuecomment-6929706145), or supply it as review context. With that text, re-run the check. The check should confirm these points: - The observed failure or requirement is stated, and the existing behavior was inspected. - Each change row is necessary and sits at the right layer. The _explicit_id_contract placement in CONTRACTS is one example. - The stated verification and stopping condition match the change. - The description does not omit material behavior. Check whether the fresh-process DiskGraph reload claim matches the four CONTRACTS lifecycle tests.

  • 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 d7235aa and 9334978.

Files selected for processing: 1

  • packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py
Files with no reviewable changes: 1

  • packages/experimental/kumo-pytorch/tests/test_inference_lifecycle.py

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

Replace the new special-ID test with a PRAGMA contract that declares
gapped explicit special-token IDs. In CONTRACTS, it runs the
fresh-process reload on both engines, DiskGraph versus reference
inference, serving and input-state inference with explicit IDs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@anle2024
anle2024 temporarily deployed to gha-kumo-workflow-tests November 16, 2026 21:45 — with GitHub Actions Inactive
@anle2024
anle2024 marked this pull request as ready for review November 16, 2026 21:57
The function name says what it builds, and the PR description keeps the
reason for the gapped IDs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 9334978d Deployed Nov 17, 2026 by anle2024 via import #2470
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