Skip to content

Align keyless tests with ordering and relation guarantees - #314

Merged
bberger62 merged 1 commit into
mainfrom
test/keyless-review-followup
Nov 24, 2026
Merged

bberger62 merged 1 commit into
mainfrom
test/keyless-review-followup

Conversation

@bberger62

@bberger62 bberger62 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to Siyang's review of #267, addressing both non-blocking test comments.

The serving-subset test asserted that an equal-timestamp, limited keyless history must choose the same row before and after rebuilding from a subset. G-KEYLESS-001 and G-SERVING-001 deliberately leave keyless IDs and equal-time tie ordering local to each preparation. Remove this test so the suite does not promise behavior the API and DiskGraph do not guarantee. Existing occurrence-preservation and serving graph checks remain.

Add parameterized DiskGraph coverage for relations joining two keyless tables and relations joining a keyless column to a keyed table's non-PK column. Both shapes lack the one primary-key side DiskGraph requires. Assert that public check() reports DG-RELATION-KEYS at the offending relation and prepare() refuses the contract before opening the engine. The in-memory positive test remains because its reference joins support these relation columns.

This changes one test file; runtime behavior and published guarantees are unchanged.

Change map

File-by-file change map and scope.

Testing Done

From packages/experimental/kumo-pytorch, using the workspace environment and PYTHONPATH=src CUDA_VISIBLE_DEVICES='':

  • python -m pytest -q tests/test_keyless_tables.py tests/test_diskgraph_unsupported.py --require-imports — 56 passed, including DiskGraph coverage.
  • ruff check tests/test_keyless_tables.py and ruff format --check tests/test_keyless_tables.py — passed.
  • git diff --check — passed.

Checklist

  • Reviewed breaking changes: none.
  • Reviewed examples and documentation: no updates needed.
  • Updated focused test coverage.

@copy-pr-bot

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

@bberger62
bberger62 temporarily deployed to gha-kumo-workflow-tests November 12, 2026 21:27 — with GitHub Actions Inactive
@bberger62

Copy link
Copy Markdown
Contributor Author

Change map

Siyang requested two non-blocking test changes in his review of #267. The existing subset test imposes an equal-time tie-order promise excluded by G-KEYLESS-001 / G-SERVING-001; DiskGraph already refuses relations without exactly one PK side, but the keyless cases lacked direct negative coverage.

File Function / scope What changed Why
packages/experimental/kumo-pytorch/tests/test_keyless_tables.py Remove test_keyless_tie_order_survives_an_ordered_serving_subset; add test_diskgraph_refuses_keyless_relations_without_a_primary_key_side Remove the unsupported cross-preparation ordering assertion. Add two cases checking public check() diagnostic code/path and prepare() refusal before engine opening for keyless-to-keyless and keyless-to-non-PK relations. Match declared keyless ordering guarantees and lock down DiskGraph's existing PK-side restriction. Preserve positive in-memory relation and serving occurrence coverage.

Focused verification: keyless and DiskGraph unsupported suites with --require-imports (56 passed), Ruff lint/format, and git diff --check.

Stopping condition: both requested test changes are covered. Runtime behavior, guarantees, and unrelated tests remain unchanged.

@coderabbitai

coderabbitai Bot commented Nov 12, 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 test suite adds parameterized coverage for DiskGraph relations where both tables lack primary keys or only the referenced table has one. It checks for the DG-RELATION-KEYS issue and verifies that prepare raises a validation error before the engine opens. The changes also remove a test comparing offline and serving event-order results after excluding an unrelated row.

Merge Risk: Minimal · up to 7efee

This change adds tests for invalid keyless relations and removes a test that asserted a guarantee the project does not make. Runtime behavior is unchanged, so merge risk is minimal.

Pre-merge checks: Passed 2 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Change Map Design Review Warning The change map (issuecomment-6836421430, marker <!-- kumo-pr-change-map -->, author bberger62) was retrieved through the GitHub API and reviewed against the diff and repository code. Verified as acc… Update the change map comment (issuecomment-6836421430). The author or authorized bot maintains it, per docs/development/review.md. Make these changes: 1. In the test row, state that the removed test pinned two things: the cross-preparati…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR changes 1 file, which is below the limit of 40. The reviewed range refs/coderabbit/pre-merge-check/base..head lists a single modified file: `packages/experimental/kumo-pytorch/tests/test_keyl…
Public Resource Access Passed The check is inapplicable because this pull request adds or modifies no external resource reference in the repository diff. - The changed-file inventory (git diff --name-status over the review range…
Full details: Pr Size

Explanation

The PR changes 1 file, which is below the limit of 40. The reviewed range refs/coderabbit/pre-merge-check/base..head lists a single modified file: packages/experimental/kumo-pytorch/tests/test_keyless_tables.py. git diff --name-only also returns one path. Line counts are ignored by this check, so the check passes.

Full details: Public Resource Access

Explanation

The check is inapplicable because this pull request adds or modifies no external resource reference in the repository diff. - The changed-file inventory (git diff --name-status over the review range) lists one file: packages/experimental/kumo-pytorch/tests/test_keyless_tables.py (M). - A search of every added or removed line in the patch for URLs, git/package sources, registries, archives, and file:// paths returned no matches. - The full patch for that file contains only test code. It adds one parameterized test, test_diskgraph_refuses_keyless_relations_without_a_primary_key_side, and removes test_keyless_tie_order_survives_an_ordered_serving_subset. The only identifiers are local repository symbols and the in-test fixture names "unsupported", "other", and "events". These are local test fixtures, which the check excludes. - The GitHub links in the PR description (PR #267 review, change-map comment) are PR narrative, not references in the changed code. They are not required to understand, build, test, use, or contribute to the changed code. The check scopes to references in the pull request's changed content, so they are out of scope. No changed reference exists to verify for anonymous access, so nothing is confirmed inaccessible.

Full details: Change Map Design Review

Explanation

The change map (issuecomment-6836421430, marker &lt;!-- kumo-pr-change-map --&gt;, author bberger62) was retrieved through the GitHub API and reviewed against the diff and repository code. Verified as accurate: - File coverage: the only changed file is packages/experimental/kumo-pytorch/tests/test_keyless_tables.py. The map lists it. - Runtime is unchanged. The diff touches only this test file. - The new negative tests match DiskGraph's rule. DiskGraph.check_contract (engines/diskgraph.py 230-240) emits DG-RELATION-KEYS at schema.relations[index] when neither or both relation keys are PKs. The fixture C-KEYLESS-001 has events keyless and users keyed. Both new parameterized shapes (None and "id" for other) hit that rule. - prepare() runs _check and raises ValidationError before engine.open (preparation.py 365-370). The new test's patch.object(engine, "open", ...) matches that order. - The in-memory positive test (test_keyless_non_primary_key_relation_remains_valid_on_reference) still exists. It uses InMemoryEngine, so it is unaffected by the DiskGraph restriction. - Guarantee citations: G-KEYLESS-001 (lines 26-29, 31-34) and G-SERVING-001 (lines 43-47) state that equal-time tie ordering is engine-defined and local to each preparation. Defects in the map's explanation: 1. Misleading scope of the removed test. The map says the test was removed for an "unsupported cross-preparation ordering assertion." The removed test also asserted single-preparation tie selection. Its offline half asserts offline ... == [11] for 12 tied rows at at=9 with limit=1. Its own comment says the test protects "numeric source-order ties." G-KEYLESS-001 says no cross-build order of tied rows is promised, and tie breaking uses "engine-defined internal identity." The map omits that the removed test pinned a source-order tie choice even inside one preparation. Because the map leaves this out, a reviewer cannot judge the full removal from it. 2. Omitted existing coverage. The map says "the keyless cases lacked direct negative coverage." That is correct for keyless shapes. But it does not cite the existing DG-RELATION-KEYS entry in tests/test_diskgraph_unsupported.py (CHECK_CASES, lines 134-143), which already checks check() refusal for a non-keyless shape. The map should say why the new prepare-before-open assertion and the keyless shapes are not duplicates. Uncertain or optional (kept separate from the required fix): - After removal, no test in this file serves a limited, ordered keyless event history from a subset. A guarantee-aligned replacement could assert that the served value is one of the tied candidates. The map does not say whether that gap is accepted. - The "56 passed" result is author-reported. I could not run the tests in this sandbox. My review relied on code reading. The code change itself is sound. The failure is in the map's explanation. The correction needs no code edit.

Resolution

Update the change map comment (issuecomment-6836421430). The author or authorized bot maintains it, per docs/development/review.md. Make these changes: 1. In the test row, state that the removed test pinned two things: the cross-preparation served result after a subset rebuild, and the single-preparation offline tie choice [11] (labelled "source-order ties"). Cite G-KEYLESS-001 lines 26-29 and G-SERVING-001 lines 43-47 as the reason neither is promised. 2. Cite the existing DG-RELATION-KEYS case in tests/test_diskgraph_unsupported.py (CHECK_CASES, ~134-143). Explain that the new cases add the keyless shapes and assert prepare() refuses before engine.open. 3. Optionally, state whether serving limit/order coverage for keyless event histories is intentionally dropped, or add a guarantee-aligned replacement assertion (for example, the served value is one of the tied amounts). Treat this as a separate, optional refinement. No code change is required for the map correction.

  • 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 b0da9fa and 7efee31.

Files selected for processing: 1

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

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 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.

The tests now match the documented preparation-local keyless identity and ordering contract, while retaining early refusal for unsupported keyless relationships. Focused regression tests passed.

@bberger62
bberger62 marked this pull request as draft November 24, 2026 22:06
@bberger62
bberger62 marked this pull request as ready for review November 24, 2026 22:06
@bberger62

Copy link
Copy Markdown
Contributor Author

/ok to test 7efee31

@bberger62
bberger62 enabled auto-merge (squash) November 24, 2026 22:12
@bberger62
bberger62 merged commit eb61b12 into main Nov 24, 2026
126 of 127 checks passed
@bberger62
bberger62 deleted the test/keyless-review-followup branch November 24, 2026 22:24

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 7efee317 Deployed Nov 12, 2026 by bberger62 via import #2118
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.

3 participants