8000 perf(query): stream certified aggregate groups (#781) by adityamukho · Pull Request #793 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

perf(query): stream certified aggregate groups (#781) - #793

Merged
adityamukho merged 6 commits into
v3from
perf/781-ordered-aggregate
Oct 29, 2026
Merged

adityamukho merged 6 commits into
v3from
perf/781-ordered-aggregate

Conversation

@adityamukho
@adityamukho adityamukho commented Oct 29, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Release completed groups for certified ordinary sum/avg, scalar min/max and Integer/nil sum-distinct queries. Effective grouping tuples can include hidden :with keys, constants and repeated slots when they reduce to one ascending Integer/Boolean dimension; existing single numeric/Boolean grouping stays supported. Argument domains are proved from constants, metadata or complete raw attribute history through the pinned reader.

Unproved arguments, pending/staged writes, callbacks, collect-set, rules and aggregate+window queries retain full-input evaluation. Any requested :with Sort remains. Limits count emitted groups after min/max drops. One growing distinct group remains linear.

Fixes #781. Targets v3; depends on merged #777 and #789. No syntax, public API, dependency, configuration or file-format change.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (requires migration or version bump)
  • Documentation / tests only

Checklist

  • cargo test passes
  • cargo clippy -- -D warnings is clean
  • cargo fmt --check passes
  • New code has tests (unit and/or integration)
  • Error paths are tested, not just happy paths
  • No unwrap() / expect() in library code paths
  • CHANGELOG.md updated under Unreleased
  • I have read PHILOSOPHY.md and this change aligns with it

Validation

Complete default suite: 2,037 active tests. Final test refinements: 202 engine tests and all 2,056 non-fault test-hook tests; the 16 unchanged fault-matrix tests passed in the complete default run. Frozen answers unchanged. Native/browser/WASI strict lint, WASI execution/release build, 14 final portable proof tests and 63 Firefox tests pass. Ten new 1K Criterion IDs smoke-tested; existing nightly routing includes all sizes. The corrected ignored 1M-group memory acceptance test passes under the actual nightly bench profile: ordered sum fits 32 MiB, while floating sum-distinct retains the QRY-012 control. Required all-features clippy passes; an exploratory integration-target lint command reports test-only violations also present on the unchanged base and is outside the CI gate.

The final default release binary is 1,263,592 bytes, 24 below the unchanged 1,263,616-byte cap. The final docs-site build passes all 13 versions / 368 pages against core 662859ce2 and docs 7664c5d. See test inventory and run boundaries and benchmark evidence, raw records and reproduction.

At 100K–10M facts, fixed-group Aggregate peaks stay at 480–1,200 bytes. At 10M, eligible full drains improve by 17.4–31.2%; limit-10 queries take 0.60–0.81 ms. All startup/RSS gates pass. Existing ordinary guards peak at +1.04%, history guards at +0.97%, and supporting ordinary controls at +1.31%, below the 5% limit. Small newly eligible grouped point queries pay 176–188 µs of proof startup cost. All 1,044 application-profile records and 126 holder records are included; the earlier size-profile matrix is explicitly supplemental.

Notes for reviewer

The approved resource-error policy follows existing ordered counts: common result-buffer allocation/charge QRY-012 can precede a later unread source failure. Aggregate-specific fallible finalizers receive no exception and keep full-drain evaluation. Tests compare both paths explicitly.

Claude approved the runtime, test refinements, complete benchmark evidence, versioned documentation and nightly acceptance correction with no blockers. Docs-site PR: project-minigraf/minigraf-docs#88.

@codecov
codecov Bot commented Oct 29, 2026
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.67735% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query/engine/order/arguments.rs 93.08% 8 Missing and 7 partials ⚠️
src/query/engine/order.rs 92.85% 4 Missing and 5 partials ⚠️
src/query/engine/aggregate.rs 90.24% 7 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 3d19abb into v3 Oct 29, 2026
19 checks passed
@adityamukho
adityamukho deleted the perf/781-ordered-aggregate branch October 29, 2026 12:08
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

0