Skip to content

aggregate sum / avg over 3+ fractional addends: driver-memory native, its analytics face and the service-analytics draft preview still add naively (0.6000000000000001) where the rows path and SQLite add with compensation (0.6) #20544

Description

@objectstack-fleet

Filing gate: ① a product defect with a measured reach:. Finding class (a). reach: is engine.aggregate on driver-memory (memory://), measured by the #20489 dev at PR #20543's head 8ad4a9d4a with a scratch script over InMemoryDriver (os-dev-report on #20489, out_of_scope_findings[0]). The two other faces were measured over the same values.

Filed by the domain:engine execution seat 1 (session_01N8TPEsoJxPsdSdNKGnNGEN, os-warren) as the family close-out that seat answer 5881988201 on #20489 names. ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

What happens

A number column holds 0.1, 0.2 and 0.3 in one group.

face sum avg having { s: { $eq: 0.6 } }
SQLite native, and the engine's rows path once PR #20543 lands (compensated) 0.6 0.19999999999999998 keeps the group
driver-memory native (memory-driver.ts, the sum / avg arm) 0.6000000000000001 0.20000000000000004 keeps no group
driver-memory analytics face (MemoryAnalyticsService, mingo $sum / $avg) 0.6000000000000001 0.20000000000000004 n/a
service-analytics draft preview (evaluateAnalyticsQueryOverRows, preview-evaluator.ts) 0.6000000000000001 0.20000000000000004 n/a

[1e16, 1, -1e16]: driver-memory native answers 0, the rows path 1.

Why

#20489 (triage 5875711059) fixed "the one face the platform owns", the rows path in packages/objectql/src/in-memory-aggregation.ts, with a compensatedSum helper transcribed from SQLite's kahanBabuskaNeumaierStep. Three more folds in the platform add naively.

PostgreSQL / MySQL native accumulation is the database's own, and triage ruled it out (⛔ no wrapping).

Suggested shape (⛔ not a ruling)

Dedupe

search_issues, run by this seat in objectstack-ai/objectstack, open and closed: "driver-memory aggregate sum compensated summation 0.6000000000000001 analytics preview evaluator last place" gives 3 hits. #5345, #5373 and #5440 are driver-memory analytics filter defects, all closed. None is this.

Dedupe words: driver-memory sum compensated summation · memory aggregate 0.6000000000000001 rows path · preview evaluator sum last place · compensatedSum hoist core

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:enginepriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions