Skip to content

test(core): extend registrar, resource, and join coverage - #1038

Merged
beojan merged 3 commits into
Framework-R-D:mainfrom
knoepfel:test/extend-coverage
Nov 24, 2026
Merged

beojan merged 3 commits into
Framework-R-D:mainfrom
knoepfel:test/extend-coverage

Conversation

@knoepfel

@knoepfel knoepfel commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Extend regression coverage for registrar failures, join receiver lookup, and duplicate resource registration.

Aided by GPT-6.1 Sol

  • Tests: Added regression coverage for registrar creator exceptions, including single invocation and clean destruction.
  • Tests: Expanded join coverage for invalid receiver indices, selector-based receiver lookup, input readiness, selector order, and index-port metadata.
  • Tests: Strengthened duplicate resource registration checks to confirm duplicates do not construct another resource and that the original resource remains accessible.
  • CI: Results for the current head are not available.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6fcd56ee-5174-485d-971a-9104a02e331e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

The changes add tests for registrar creator exceptions, join receiver behavior and port metadata, and duplicate resource registration.

Changes: Registrar lifecycle

Layer / File(s) Summary
Registrar creator exception handling
test/core_misc_test.cpp
A test checks that a creator exception propagates, the creator is called once, and the error list is empty after destruction.

Join receiver routing

Layer / File(s) Summary
Join routing and port validation
test/multilayer_join_test.cpp
Tests cover receiver mappings, output readiness, selector order, invalid lookups, and index-port layer metadata across multilayer, same-layer, and fold joins.

Duplicate resource registration

Layer / File(s) Summary
Duplicate registration behavior
test/resources_test.cpp
Construction-counting fixtures verify that duplicate registrations throw without constructing another resource, while the original resource or limiter remains accessible.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: greenc-fnal, marcpaterno

Merge Risk: Minimal · previous review c6493

No behavior issue has been established that would prevent merging these tests.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the added test coverage for registrar failures, resource registration, and joins.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main    #1038      +/-   ##
==========================================
+ Coverage   91.48%   91.57%   +0.08%     
==========================================
  Files         184      184              
  Lines        6062     6062              
  Branches      973      973              
==========================================
+ Hits         5546     5551       +5     
+ Misses        328      325       -3     
+ Partials      188      186       -2     
Flag Coverage Δ
amd64 91.57% <ø> (+0.08%) ⬆️
arm64 91.57% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5234656...7932006. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@knoepfel
knoepfel force-pushed the test/extend-coverage branch 2 times, most recently from 5185fd5 to abec092 Compare November 4, 2026 16:26
@coderabbitai coderabbitai Bot mentioned this pull request Nov 4, 2026
@knoepfel
knoepfel force-pushed the test/extend-coverage branch from abec092 to c649360 Compare November 10, 2026 15:45
@knoepfel knoepfel changed the title fix(core): prevent duplicate registration after registrar moves test(core): extend registrar, resource, and join coverage Nov 10, 2026
@knoepfel

Copy link
Copy Markdown
Member Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Full review finished.

@Framework-R-D Framework-R-D deleted a comment from coderabbitai Bot Nov 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional comments: 1

test/multilayer_join_test.cpp-147-152: 1

147-152: Trivial · Maintainability & Code Quality · Low value

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Move the using internal::receiver_for; declaration above the lambda, or confirm it is not needed.

The lambda at Lines 147-150 calls internal::receiver_for<3> with a qualified name. It does not depend on the using-declaration. Line 152 only serves the unqualified call at Line 169. That call passes the template argument <3>.

The code works as written. The ordering is still confusing, because the using-declaration sits between the lambda and its first use. Place it next to the other setup lines, or qualify the Line 169 call with internal::. A reader then does not have to track which calls use ADL or the using-declaration.

I did not check how the unqualified receiver_for<1ull>(join, 2u) call at Line 183 resolves for fold_join_node. It may rely on a using-declaration earlier in the file, in the unchanged lines I could not see. Please confirm that this resolves to the intended overload.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 3b3759dc-8e15-4265-b053-546819e05353
Commits

Reviewing files that changed from the base of the PR and between 9e52668 and c649360.

Files selected for processing: 3

  • test/core_misc_test.cpp
  • test/multilayer_join_test.cpp
  • test/resources_test.cpp

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

Review details

Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 1

Source excerpt: **Authoritative sources**: `.clang-format` and `.clang-tidy` are the ground truth for formatting and naming.

CodeRabbit inference engine (AGENTS.md)

Files:

  • test/core_misc_test.cpp
  • test/multilayer_join_test.cpp
  • test/resources_test.cpp
Additional comments: 5

test/core_misc_test.cpp: 1

2-2: LGTM!

Also applies to: 11-11, 100-118

test/resources_test.cpp: 1

47-55: LGTM!

Also applies to: 289-293, 296-297, 302-306, 309-310

test/multilayer_join_test.cpp: 3

84-84: LGTM!


98-101: LGTM!


172-198: LGTM!

@knoepfel
knoepfel force-pushed the test/extend-coverage branch 2 times, most recently from a3fd174 to 6e99b6e Compare November 11, 2026 18:02

@greenc-FNAL greenc-FNAL left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review context

Reviewed only commit 6e99b6ed3e37f70c3eccbc4ff132160059b427eb (test(core): extend registrar, resource, and join coverage). Existing tests and implementation were inspected only to establish context. This was a static review; tests were not run.

Agent: Kilo, QA/testing specialist (review performed inline; no subagents). Model: fnal-azure/azure/gpt-6.1-sol (display name azure/gpt-6.1-sol). Effort: medium. Cost: ~$0.23

Given review prompt

Please review ONLY the latest commit on this branch. Evaluate the tests for:

  1. Triviality
  2. Tautology
  3. Appropriateness - are we testing the right thing(s), and are the tests meaningful and probative
  4. Clarity - is it obvious to the casual code reader what each test exercises?
  5. Coverage - unnecessary duplication, or testing gaps that could be filled without undue work
  6. Encapsulation - is there unnecessary use of components not under test that should be avoided or mocked?

Findings

Medium: Same-layer join coverage does not distinguish ID matching from FIFO joining

Location: test/multilayer_join_test.cpp:148–168.

Every input carries the same message_id, and each port receives only one message. The test meaningfully checks waiting for all inputs and preserving selector order, but a mistakenly configured FIFO/queueing join would also satisfy every assertion. Reordering submissions across ports does not exercise matching between different data units. The implementation explicitly promises joining by ID.

Recommendation: Add a separate scenario with two IDs and different arrival orders on different ports. First provide one message per port with mismatched IDs and assert no output; then supply the matching messages and verify that each output tuple contains only one ID and the corresponding stores. Do not assume an ordering between completed output tuples.

Low: Added assertions exercise behavior not identified by their test names

Locations: test/multilayer_join_test.cpp:169, test/multilayer_join_test.cpp:190–197, and test/resources_test.cpp:287–310.

The same-layer test also checks rejection of an unknown selector. The fold receiver test also checks routing/counting-layer metadata. The resource sections now establish rejection before construction and preservation of the original registration, not merely that duplicates throw. These checks are useful, but their purposes are partially hidden from someone scanning test names.

Recommendation: Give the unknown-selector and fold-metadata checks separately named sections or test cases. Rename the resource sections to describe their stronger guarantee, for example, “duplicate unlimited registration preserves the existing resource without constructing another.”

Assessment against the six criteria

  • Triviality: No problematic trivial tests. Construction counters, the incomplete-join check, selector-order checks, and boundary rejection checks can detect real regressions.
  • Tautology: No genuine tautologies. Comparing returned receivers with explicit input ports is an independent expectation about the partition-port offset. Comparing resource identities before and after rejection checks preservation, not self-equality.
  • Appropriateness: Strong overall. The registrar test checks exception propagation and exactly-once creator invocation across destruction. Resource changes substantially strengthen existing duplicate-registration tests. Join metadata is a legitimate routing contract to test directly.
  • Clarity: Setup and assertions are generally readable. Naming or separating the additional scenarios would improve discoverability.
  • Coverage: ID matching is the most valuable missing scenario. The duplicate-resource sections cover separate implementation paths and are not unnecessary duplication. Both the first invalid fold index and size_t::max() are justified: the latter exercises the index + 1 wraparound boundary.
  • Encapsulation: Appropriate. Counted resources are small test doubles, and the throwing registrar callback avoids constructing an actual graph node. Real TBB graphs, queue sinks, and minimal product stores are justified for testing join wiring and observable output; mocking them would weaken those checks. The fold initializer is already a minimal stub.

Overall, this commit adds meaningful regression protection rather than coverage padding. The main recommended improvement is a focused multi-ID join test; the remaining feedback concerns test discoverability and organization. Submitted as a non-blocking comment review.

@knoepfel
knoepfel force-pushed the test/extend-coverage branch from 6e99b6e to a508521 Compare November 12, 2026 18:03
@knoepfel

Copy link
Copy Markdown
Member Author

@greenc-FNAL, see commit a508521, which I believe addresses the GPT-6.1 Sol review.

greenc-FNAL
greenc-FNAL previously approved these changes Nov 20, 2026

@greenc-FNAL greenc-FNAL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Scope

Reviewed only commit a508521a2b3d29af3f0357b4f455475173d4c619 (test(core): verify join ID matching and clarify test scenarios), specifically its attempts to address review 5877522094. The earlier reviewed test content is unchanged in these two files after the parent commit was rebased. Other PR changes are outside this review.

Findings and disposition

No remaining issues found in the scoped fixes. Approve.

  • The new same-layer scenario now supplies two IDs in different orders across ports, checks that mismatched arrivals produce no output, and verifies exactly two homogeneous output tuples covering both IDs without requiring output order. This resolves the original FIFO-versus-ID-matching coverage gap. Using ID-only messages is appropriate for this scenario; the separate selector-order scenario retains its store-identity checks.
  • Unknown-selector rejection and fold routing/counting metadata now have separately named sections. The resource section names now explicitly identify rejection without constructing another resource, while retaining the original-registration identity checks. These changes address the report's discoverability concern without removing assertions.

Validation

Used an isolated standalone clone at the reviewed SHA, mounted into a container based on ghcr.io/framework-r-d/phlex-dev:latest (image ID sha256:cef34af082d20450c2bdb5235b8457b9fd5109d2d5a9ff47a6a5647db9793f4f), with the image's Spack environment activated: GCC 15.3.0 and CMake 4.4.4. Configured a Debug/Ninja build with PHLEX_USE_FORM=OFF; built targets multilayer_join and resources; ran CTest selection ^(multilayer_join|resources)$ with --no-tests=error --timeout 90. Both passed: 60 assertions in 4 join test cases and 17 assertions in 2 resource test cases.

Also temporarily replaced the underlying tag-matching join with a FIFO/queueing join in the isolated clone. The new ID-matching case failed as expected, including the initial no-output assertion and tuple-ID comparisons. Restored the implementation, rebuilt, and reran both CTests successfully; no tracked changes remain. The full suite and FORM-enabled configurations were not run.

Review performed inline by Kilo (fnal-azure/azure/gpt-6.1-sol), without subagents.

Comment thread test/multilayer_join_test.cpp Resolved
greenc-FNAL
greenc-FNAL previously approved these changes Nov 21, 2026
beojan
beojan previously approved these changes Nov 23, 2026
- Use direct construction for `algorithm_name` instead of the removed `create` factory.
- Construct product specifications from the fold join test’s named algorithm.
@greenc-FNAL
greenc-FNAL dismissed stale reviews from beojan and themself via 7932006 November 23, 2026 23:44
@greenc-FNAL
greenc-FNAL requested a review from beojan November 24, 2026 16:32
@beojan
beojan merged commit 2e2612d into Framework-R-D:main Nov 24, 2026
42 checks passed
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