Skip to content

fix(engine): count distinct link chart endpoints at capacity - #2189

Closed
giswqs wants to merge 1 commit into
mainfrom
sweep/engine-link-chart-2026-11-15
Closed

giswqs wants to merge 1 commit into
mainfrom
sweep/engine-link-chart-2026-11-15

Conversation

@giswqs

@giswqs giswqs commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

A relationship linking a feature to itself now consumes one chart node, including the final free slot. Previously the capacity check counted both endpoints, so 3,000 independent self-links stopped at 2,999 nodes and links with an unnecessary truncation notice.

Once the node budget is full, an origin absent from the chart now skips its destination scan. Existing origins still scan for links to existing chart nodes. This avoids a potentially quadratic rejected-candidate pass after saturation without changing the count of omitted relations.

The capacity regression now covers 3,000 distinct self-links and expects every node/link, without a truncation notice.

Sweep findings: distinct endpoints, duplicate report, saturated destination scan.

Testing

  • Passed direct rustfmt and git diff --check.
  • Targeted capacity regression and full workspace tests are pending. Submitted without waiting for long-running tests as requested; CI must pass before merge.
  • Validation environment: GDAL 3.13.3.

UI evidence

Before/after evidence for the exported chart at its node limit is pending. The ordinary chart appearance is unchanged.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 05efd95c-e387-412a-af81-a70965a43c45
Commits

Reviewing files that changed from the base of the PR and between ce40749 and f43f876.

Files selected for processing: 2

  • crates/engine/src/cmd/sharing.rs
  • crates/engine/src/tests.rs
  • 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

@giswqs

giswqs commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Superseded by the combined engine correctness PR #2201.

@giswqs giswqs closed this Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I found no correctness bugs in the change. I checked the new self-link accounting, the early continue, and the new test against link_chart in crates/engine/src/cmd/sharing.rs. I did not compile or run the tests, since this review has no shell, so the new assertions are verified by reading only.

Bugs

  • None. A self-link whose origin is absent now needs one slot (new = 1). node() then finds the origin it just pushed when it resolves the destination, so 3,000 self-links produce 3,000 nodes and 3,000 links, as the test expects. Distinct layers are unaffected, because destination != origin is always true for them. Confidence: high (~90%).
  • The early continue at sharing.rs:1423 (a.is_none() && nodes.len() >= MAX_NODES) only skips candidates the existing check would reject anyway. Any link from an absent origin needs at least one new node. related and relations are filled before this point, so the omitted-relation count does not change. Confidence: high.

Security

  • None found. No parsing or I/O changes.

Performance

  • The early exit removes the rejected-candidate scan for absent origins once the node budget is full. Before this change, that scan could visit every relation on many-to-many keys, so the change helps. Origins already in the chart are bounded by MAX_NODES, so no new hot path appears. Confidence: medium-high.

Quality

  • The early continue at crates/engine/src/cmd/sharing.rs:1423 has no comment. The reason it is safe (relations are counted above, and any link from an absent origin needs a slot) is not written down, and the comment block above does not mention it. A one-line comment would help. This is a nit for the release quality pass.

AGENTS.md

  • Tests have not been run. The PR body says the targeted capacity regression and the full workspace tests are pending. AGENTS.md requires cargo xtask ci before every commit, so this must pass before merge. Confidence: certain that they are unrun.
  • Visible change without screenshots. A self-link relationship at the node limit now draws 3,000 nodes instead of 2,999, and no "Shows" line appears. AGENTS.md asks for before/after screenshots for visible changes, and the PR body says that evidence is pending. Confidence: medium, since the case is an edge case.
  • Otherwise the change follows the guidelines. It adds no unwrap, panic, or unsafe. It adds a regression test with a clean-input "no notice" check, and no timer waits. It adds no new background work.

No prior review threads exist on this PR, so there were no earlier concerns to leave alone.

Change size

Compared: the whole PR against main (merge base ce40749 to PR head f43f876).

Measure Value
Files changed 2 (0 added, 2 modified, 0 removed, 0 renamed)
Size before 2.97 MB
Size after 2.97 MB
Total size change +916 B
Path Before After Change
crates/engine/src/tests.rs 2,952.2 KB 2,952.9 KB +714 B
crates/engine/src/cmd/sharing.rs 89.1 KB 89.3 KB +202 B

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.

1 participant