8000 feat(query): add ordinary avg with window-compatible value handling by adityamukho · Pull Request #791 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

feat(query): add ordinary avg with window-compatible value handling - #791

Merged
adityamukho merged 3 commits into
v3from
feat/777-avg
Oct 29, 2026
Merged

adityamukho merged 3 commits into
v3from
feat/777-avg

Conversation

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

Ordinary (avg ?v) currently fails with PRS-027. This adds it to v3's shared accumulator and engine path: 10, "unknown", 20, nil averages to 15.0, matching window avg by skipping nonnumeric values and counting only numbers. Existing groups with no numbers return nil; queries with no matching bindings retain the existing no-row behavior.

The implementation reuses window avg's exact summation and mean conversion, including NaN/infinity, overflow and signed-zero behavior. Retained exact-sum heap state for ordinary sum/avg is charged to the query memory limit before allocation and released on finish/error/rewind/close. Other aggregate value semantics and ordered optimization remain unchanged.

Repository docs and grammar fixtures are synchronized. Current tracker references use the v3.0.0 milestone after #383's retirement. This is the v3 portion of #777; v2 docs are #790 and the docs-site companion is project-minigraf/minigraf-docs#86. Keep #777 open until all scopes land. Other aggregate consistency work is #789. For #781: avg is infallible over decoded values, skips nonnumbers, and retains metered exact-sum state; ordered eli 8000 gibility still needs its own proof.

Validation:

  • Failing regression tests observed before implementation; all 13 added focused tests now pass, including the test-hooks matrix.
  • Plan-independence (16 tests) and input-order matrix pass; default/test-hooks enumeration confirms 2,018/2,053 tests.
  • Strict native, browser and WASI clippy; formatting and diff checks pass.
  • Release binary: 1,263,144 bytes, below the unchanged 1,263,616-byte cap.
  • Claude approved both design/plan and final code/docs review.
  • Final-revision CI passes the full test-hooks suite (2,035 passed, 18 ignored), Linux/macOS/Windows defaults (2,001 passed, 17 ignored on Linux), MSRV, coverage gates and patch coverage, WASI, Chrome and Firefox. All PR checks are green.
  • Bench broad unit verification passed 1,148 tests; two unchanged cross-process lock tests hit their child-readiness timeout on the loaded disk, then passed unchanged using temporary memory-backed storage. The full CI suites supersede that partial bench run. Redundant bench integration/site rebuilds were stopped after CI started/passed, and task scratch was removed; logs are preserved.

No v2 runtime, public API, dependencies or file-format changes. No merge requested.

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

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 0fc97bd into v3 Oct 29, 2026
19 checks passed
@adityamukho
adityamukho deleted the feat/777-avg branch October 29, 2026 05:07
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