Skip to content

Fix long event ages on DiskGraph nanosecond clocks (C-027) - #514

Merged
nittin-murthi merged 1 commit into
mainfrom
codex/c027-long-event-age
Nov 24, 2026
Merged

nittin-murthi merged 1 commit into
mainfrom
codex/c027-long-event-age

Conversation

@nittin-murthi

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

Copy link
Copy Markdown
Contributor

Fixes #497.

File-by-file change map

On a nanosecond clock, a 105-day event age is 9,072,000,000,000,000 ticks. Arrow's default cast rejects that count even though the requested result, 9,072,000 seconds, fits in float64.

DiskGraph now subtracts timestamps in integer ticks and converts the elapsed ticks with the package's existing float64 helper. Checked subtraction catches a true int64 overflow before it can produce a negative age.

Verification

Reused C-027 from #447 with native DiskGraph and Parquet anchors. On main (2a3872ead), the 105-day nanosecond case failed and the three controls passed. On this branch all four pass. The event-age, temporal-declaration, native latest-anchor and DiskGraph backend modules passed all 61 tests. 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:46 — with GitHub Actions Inactive
@nittin-murthi

Copy link
Copy Markdown
Contributor Author

Change map

C-027 failed before DiskGraph delivered the batch for a 105-day-old event. Its four cases exercise both sides of the Arrow conversion boundary on microsecond and nanosecond clocks.

File Function / scope What changed Why
packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py DiskGraphSource._model_field Subtract ticks with overflow checking, then convert the elapsed ticks with arrow_float64. Preserves short intervals at large timestamps and delivers long event ages in the declared float64 unit.
packages/experimental/kumo-pytorch/tests/test_time_delta.py _contract, test_native_event_age_across_long_histories Parameterize the fixture's clock and check the age and validity at 104 and 105 days using native Parquet anchors. Reproduces the original failure through the package API and catches a fallback to Python batching.

@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

DiskGraph now uses checked subtraction and Arrow float conversion when it computes EventTimeDelta values. Tests cover native anchor delivery with microsecond and nanosecond timestamps over 104- and 105-day intervals. They verify that the resulting age is valid and equals the elapsed seconds, and that request and assembler fallback paths are not used.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 80f54

This change fixes DiskGraph event-age conversion for long intervals on nanosecond clocks and adds regression coverage for microsecond and nanosecond timestamps. No concrete merge-blocking risk was found.

Security architecture risk: Minimal · up to 80f54

The fix lets DiskGraph return ages for longer event histories and rejects arithmetic overflow instead of returning a wrapped value. It does not change which data the calculation can access.

Pre-merge checks: Passed 2 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Change Map Design Review Inconclusive The check assesses the PR conversation comment that starts with <!-- kumo-pr-change-map -->. My tools cannot read PR conversation comments. The repository checkout does not contain that comment; the… To complete this check, make the change map comment readable to the reviewer (or provide its text). Then re-run the check with these points covered: 1. Name the exact Arrow operation and error that fails on main for the 105-day nanosecond c…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR changes 2 files, below the threshold of 40. The git diff --name-status inventory between refs/coderabbit/pre-merge-check/base and refs/coderabbit/pre-merge-check/head lists two modified files…
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 PR changes two files: `packages/experimental/kumo-pytor…
Full details: Pr Size

Explanation

The PR changes 2 files, below the threshold of 40. The git diff --name-status inventory between refs/coderabbit/pre-merge-check/base and refs/coderabbit/pre-merge-check/head lists two modified files: - packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py (M) - packages/experimental/kumo-pytorch/tests/test_time_delta.py (M) No renames, additions, or deletions appear. Line counts are ignored under this check, so the result is PASS.

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 PR changes two files: packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py (2 lines: subtract_checked and arrow_float64) and packages/experimental/kumo-pytorch/tests/test_time_delta.py. A scan of all added lines found no URLs, git or registry references, commit-pinned sources, or package-source locations. The only additions are Python imports (pyarrow, conformance.assertions, kumo.pytorch.engines.native_anchors) and in-code values. Imports name modules; they do not add a source location. The PR modifies no dependency manifest or lockfile. Because the PR adds or changes no external resource reference, the check does not apply and passes.

Full details: Change Map Design Review

Explanation

The check assesses the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt;. My tools cannot read PR conversation comments. The repository checkout does not contain that comment; the only match for the marker is in docs/development/review.md, which describes the required format. The PR description links the map at issuecomment-7117348186, but I cannot fetch it. The map's Change map, rationale, and stopping condition therefore could not be reviewed, so this check cannot pass or fail on its content. Partial code evidence from the PR range (refs/coderabbit/pre-merge-check/base..head): - diskgraph.py (DiskGraphSource._model_field, lines 1884-1897): subtract becomes subtract_checked, and cast(..., float64) becomes the existing arrow_float64 helper. The change is small and stays in the layer that computes EventTimeDelta. arrow_float64 (contract/dtypes.py 288-299) uses safe=False for non-decimal inputs, so the helper does not add a range check. - test_time_delta.py: adds a parametrized native Parquet-anchor test over 104 and 105 days for us and ns units. It rejects the request and assembler fallback paths and checks that the age equals the elapsed seconds. The test covers the reported case. Open design question, not a proven defect: the PR description says Arrow's default cast rejects 9,072,000,000,000,000 ticks. That value equals 567 × 2^16 × 5^12, so it is exact in float64. A precision-loss check would therefore not reject it. The actual failing Arrow operation is not identified in the PR text or code I could inspect. The change map should name the real failing operation, or the stated mechanism should be verified. Checked subtraction does guard against true int64 overflow, which is a valid reason for the change.

Resolution

To complete this check, make the change map comment readable to the reviewer (or provide its text). Then re-run the check with these points covered: 1. Name the exact Arrow operation and error that fails on main for the 105-day nanosecond case. Show that the explanation matches the observed error, since 9,072,000,000,000,000 is exactly representable in float64. 2. Justify subtract_checked as the necessary guard, and state that a true int64 overflow still raises an error instead of producing a negative age. 3. State the stopping condition: why no other EventTimeDelta or DiskGraph paths need changes. 4. Keep the test coverage description focused on the reported case and the fallback-rejection controls.

  • 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 a8173e2 and 80f54dd.

Files selected for processing: 2

  • packages/experimental/kumo-pytorch/src/kumo/pytorch/engines/diskgraph.py
  • packages/experimental/kumo-pytorch/tests/test_time_delta.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.

Checked integer tick subtraction followed by the existing float conversion fixes ordinary long histories on nanosecond clocks without losing short-interval precision first. All 7 focused time-delta tests passed.

@nittin-murthi
nittin-murthi enabled auto-merge (squash) November 24, 2026 22:32
@nittin-murthi
nittin-murthi merged commit 7faee6f into main Nov 24, 2026
121 checks passed
@nittin-murthi
nittin-murthi deleted the codex/c027-long-event-age branch November 24, 2026 22:49

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 80f54dd2 Deployed Nov 23, 2026 by nittin-murthi via import #3151
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 compute the age of a 105-day-old event on a nanosecond clock

3 participants