Skip to content

perf(results): reconcile independent diagnostics with local indexes - #761

Merged
rng1995 merged 4 commits into
NVIDIA:mainfrom
Afloat16:perf/reconcile-independent-diagnostics
Nov 19, 2026
Merged

rng1995 merged 4 commits into
NVIDIA:mainfrom
Afloat16:perf/reconcile-independent-diagnostics

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Summary

After a severity change or scanner finding deduplication, recalculate_keeping_independent() rebuilds the finding-derived state and restores independent diagnostic lines. It checks every candidate against the growing error or warning list. Large collections of independent diagnostics therefore make this restoration quadratic.

Use local membership sets for the restoration checks. The output lists retain their order and any repeated lines already produced by findings. Gate errors remain once, and keep_repeated_warnings=True still appends every supplied warning. Sets live only for one rebuild, so later mutations cannot leave a stale index.

Related changes in #564 introduced the shared reconciliation behavior. This change preserves that behavior and speeds its real scanner and policy consumers. The separate reporting-summary occurrence merge from #739 is unchanged.

Measurement

Python 3.12.14, one warm-up and the median of three timed calls per scenario. Each fixture has the stated number of independent errors and independent warnings; fixture construction and output serialization are outside the timed region. Scanner deduplication receives two repeated findings; the policy case lowers one finding on an incomplete scan.

Consumer Diagnostics per kind Before After
SkillSpector finding deduplication 5,000 0.220556 s 0.002357 s
SkillSpector finding deduplication 10,000 0.896118 s 0.009159 s
SkillSpector finding deduplication 20,000 3.318354 s 0.014722 s
Policy severity override 5,000 0.125835 s 0.001590 s
Policy severity override 10,000 0.513991 s 0.003138 s
Policy severity override 20,000 1.740980 s 0.007595 s

All six complete serialized result hashes match before and after. The baseline model and consumer implementations are identical at d2cb138 and cbda65c1. These local measurements demonstrate the removed repeated scans, not a production latency guarantee.

Verification

Ten new compatibility cases pass both before and after: all combinations of incomplete state and retention options, existing finding multiplicity, gate/error overlap, first-seen ordering, input independence, real scanner deduplication and a real policy override.

  • Result, policy, diagnostic and finding-verification tests — 108 passed.

  • Security consumer selection (dedup or llm_verdict or llm_verification) — 18 passed, 1,468 deselected.

  • Full lint, changed-file formatting and git diff --check — passed.

  • Wheel and sdist builds — passed.

  • I am familiar with the Contributing Guidelines

  • Added or updated focused tests

  • Updated documentation for user-visible changes (Unreleased changelog)

  • Ran make lint equivalent: python -m ruff check src tests

  • Full make test did not complete successfully in this environment (see below)

  • Ran make build equivalent: python -m build

  • Did not add credentials, private datasets, or proprietary benchmark content

The earlier full-suite attempt stops on unchanged base d2cb138 in test_gitlab_enriched_tier1_applies_the_keyless_job_baselines: its shell fixture hard-codes mktemp -d /tmp/..., while this workspace has no /tmp. That base run reached 456 passed, 2 skipped and 19 deselected before the failure.

Release Impact

  • Updated CHANGELOG.md

Keep local membership sets while restoring independent errors and warnings.
Preserve their order, existing finding multiplicity, gate failures, summary
counts and the option to retain repeated warnings.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Resolve the Unreleased changelog insertion while preserving exactly
this pull request's code, tests, and release note against current main.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@rng1995 rng1995 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.

Thanks for your contribution, @Afloat16. Reviewed 024be56715d1; no actionable defects found in the changed code.

Focused validation: 1,572 model, policy and security tests passed.

Hosted CI is still awaiting authorization or completion; this is a code-review approval, and does not certify a full hosted CI pass.

@rng1995 rng1995 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.

Thanks @Afloat16 for this contribution! I reviewed 024be56715. I reproduced the problem on main, confirmed this change fixes it, and ran the new and related tests on this head (all pass). I left 1 inline comment (1 P3).

@chrisknvidia chrisknvidia 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.

Thanks. Independently confirmed: 2,500 seeded scenarios through the real apply_policy and dedup consumers produce byte-identical results with order preserved, a crafted --policy run is identical on both trees, and 20k items go from about 4 s to 12 ms. The open P3 about the new tests also passing on main stands; one test that fails against the old restoration loop would make this safer to keep.

Merge current main and preserve the published release history.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Keep both release-note entries and preserve the existing PR implementation and regression tests.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@rng1995 rng1995 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.

Thanks @Afloat16 for this contribution and for addressing the earlier review! I re-checked 9f0bdb78b0: all 1 earlier comment is resolved in the code, the tests pass, and I found nothing new. Approving.

@rng1995
rng1995 merged commit a3bb7e9 into NVIDIA:main Nov 19, 2026
25 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