8000 post-1.0: add sliding row frames for window functions · Issue #183 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

post-1.0: add sliding row frames for window functions #183

Closed

Description

@adityamukho

Roadmap source

ROADMAP.md: Phase 7.7a notes :rows N preceding sliding frames were deferred to the post-1.0 backlog.

Work item

Add bounded sliding row frames to window functions.

Acceptance criteria

  • Extend parser and AST for :rows N preceding frame syntax.
  • Evaluate aggregate window functions over bounded preceding frames.
  • Preserve current unbounded-preceding behavior as the default.
  • Add tests for edge rows, partitions, and ordering ties.
  • Update Datalog reference documentation.
  • modified the milestones: v3.0.0, v3.1.0 on Sep 26, 2026
  • modified the milestones: v3.1.0, v3.0.0 on Oct 9, 2026
  • modified the milestones: v3.0.0, v3.1.0 on Oct 20, 2026
  • adityamukho commented on Oct 20, 2026

    @adityamukho
    CollaboratorAuthor

    Moved to v3.1.0 (as ROADMAP/CLAUDE.md already list it), to be built after #551 so it exists only on the streaming engine, not on the executor that #551 deletes.

    Depends on #547 (spec docs/superpowers/specs/2026-10-20-aggregate-window-engine-design.md, merged in #640):

    • a window sorts each partition by its :order-by value under one total value order (value_order, spec §3.1), then by the other :find-named variables, then input position (§4.1). Rows that tie on all of these are indistinguishable in the output, so row-based results are the same on every plan;
    • without a frame clause, running aggregates use SQL peer semantics (§4.2): every row tied on :order-by gets the value at the last peer;
    • Window holds its whole sorted input (§6), so the work here is per-row evaluation only.

    For :rows N preceding: an explicit ROWS frame over that total order. The default stays the peer rule above ("current unbounded-preceding behaviour" means peers once #547 lands, not the per-row running value of v2.x). Exact sliding sums: the exact float accumulator (§3.2) can remove the row leaving the frame without rounding error; min/max via a monotonic deque under value_order; registered window functions have no inverse and are recomputed per frame.

  • modified the milestones: v3.next, v3.0.0 on Oct 26, 2026
  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      enhancementNew feature or requestrustPull requests that update rust code

      Type

      No type

      Projects

      No projects

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        0