Skip to content

[Goal] Fix missing-value parity in real Wasm rolling kernels #496

Description

@mrjf

Goal

Make all-missing rolling-window results agree between the existing TypeScript fallback and the real Rust/Wasm acceleration path, without a Wasm trap. This is a focused follow-up to #349, not a claim that the whole pandas or Wasm port is complete.

Completion Contract

  • Reproduce rollingMedianF64Accelerated(new Float64Array([NaN, 1, NaN, 3]), 1, 0) before and after loadWasm(). The loaded implementation must return [null, 1, null, 3], not throw RuntimeError: unreachable.
  • Check rolling min/max for empty/all-missing windows at minPeriods = 0, preserving current TypeScript fallback semantics including infinities. Cover positive minPeriods, mixed finite/NaN input, empty input, and representative window sizes so the fix does not only special-case the reproduction.
  • Add Rust regression tests and TypeScript integration tests that execute the actual accelerated wrappers with the Wasm module successfully loaded. Test the fallback in an isolated process before loading, so previous tests cannot secretly choose the backend. A missing module or early return is a failure, not passing evidence.
  • Build Wasm from the candidate's Rust source; do not validate only the old checked-in binary. Keep the required generated bindings/binary consistent with source if this repository tracks them.
  • Confirm candidate-head CI and the focused source-built Wasm verification pass, then reconcile published evidence in a subsequent run. Do not close the issue on a queued push, stale branch, syntax-only test, or fallback-only result.

Evidence / Verification

Record the candidate SHA and actual commands, outcomes, and assertion counts. Run cargo test --locked --manifest-path rust/Cargo.toml, wasm-pack build --target nodejs rust/ --out-dir pkg, the relevant bun test tests/wasm/ tests, affected core/window tests, bun run typecheck, and bun run lint. Report missing tooling or failing checks honestly. Link the published PR and current-head runs. A standalone Wasm Verification workflow is being installed; use it when available and do not claim its result until it completes.

Scope and Constraints

Only change the relevant Rust rolling kernels, focused tests under tests/wasm/ and Rust tests, and corresponding generated rust/pkg/ artifacts when necessary. Do not modify README, AGENTS, .autoloop/programs/, workflow policies, benchmarks, general Series/DataFrame behavior, or issue #1. Preserve existing fallback semantics; do not weaken assertions or mark cases ineligible to get a green result. One small coherent fix per commit.

Iteration Policy

First reproduce the crash and semantic mismatch, add a focused regression, fix the smallest coherent defect, and publish one canonical PR. A later run checks the real published candidate and CI evidence before accepting or completing it. If verification exposes another in-scope defect, fix it in a separate small checkpoint. Do not repeat an unchanged diagnosis or create duplicate PRs.

Blocked Stop Condition

Stop and report one actionable blocker if required tooling cannot run, the permitted scope cannot repair the behavior, branch publication fails, or evidence contradicts the claimed result. Leave the issue open and record the next required action. Never infer successful verification from unavailable results.

Activity

  1. added
    goalAgentic goal workflow should continue working this issue
    on Sep 17, 2026
  2. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    Goal run: active - run

    Branch: goal/496-goal-fix-missing-value-parity-in-real-wasm-rolling-kernels
    PR: pending (create_pull_request requested this run)

    Checkpoint:
    Reproduced and fixed the root cause in rust/src/rolling.rs:

    • slice_median panicked (usize underflow) on an empty vector — this was the unreachable Wasm trap for all-missing windows with minPeriods = 0. Now returns NaN.
    • rolling_min_f64 / rolling_max_f64 seeded their accumulator with NaN instead of Infinity/-Infinity, diverging from the TypeScript fallback's Math.min()/Math.max() (empty-arglist) semantics. Fixed to seed with f64::INFINITY / f64::NEG_INFINITY.

    Evidence:

    • cargo test --locked --manifest-path rust/Cargo.toml: 50 passed, 0 failed (8 new regression tests, including the exact [NaN, 1, NaN, 3] window=1 minPeriods=0 case for median/min/max, empty input, positive-minPeriods-insufficient guard, and a mixed finite/NaN multi-window case).
    • wasm-pack build --target nodejs rust/ --out-dir pkg: built from candidate source; generated .d.ts/.js diff shows only doc-comment additions.
    • bun test tests/wasm/: 71 passed, 0 failed — new integration tests call the real rollingMedianF64Accelerated/rollingMinF64Accelerated/rollingMaxF64Accelerated wrappers with Wasm loaded, plus an isolated child-process fallback check (fallback-check.ts spawned by fallback-isolated.test.ts) that never calls loadWasm().
    • bun test tests/window/: 199 passed, 0 failed (no regression).
    • bun run typecheck: passed.
    • npx biome check on changed files: 0 errors, 6 pre-existing warnings (confirmed via git stash these predate this change).
    • Committed to the canonical branch (SHA a2e11dfd22d0aadfb198db766bf3645e76689486) and requested create_pull_request.

    Result:
    active

    Next:
    A follow-up run will fetch the branch, confirm the PR was published, and check CI status on the head SHA before considering the completion contract satisfied.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • github.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "github.com"

    See Network Configuration for more information.

    Generated by Goal · copilot · auto · 246.2 AIC · ⌖ 18.3 AIC · ⊞ 12.8K · ◷
    Comment /goal to run again

  3. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    Goal status: active

    Field Value
    Branch goal/496-goal-fix-missing-value-parity-in-real-wasm-rolling-kernels
    PR pending (create_pull_request requested; not yet confirmed)
    Last Run 2026-09-17
    Run Count 1
    Latest Evidence Rust unit tests 50/50, Wasm parity tests 71/71, window tests 199/199, typecheck clean
    Remaining Work Confirm PR published and CI green on the candidate head SHA

    Summary:
    Fixed a slice_median panic on empty windows (the source of the Wasm unreachable trap) and corrected rolling_min_f64/rolling_max_f64 to seed with Infinity/-Infinity instead of NaN, matching the TypeScript fallback's Math.min()/Math.max() semantics for all-missing windows. Added Rust regression tests and TypeScript integration + isolated-process fallback tests, and rebuilt the Wasm package from source. Publication and CI evidence are pending reconciliation on the next run.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • github.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "github.com"

    See Network Configuration for more information.

    Generated by Goal · copilot · auto · 246.2 AIC · ⌖ 18.3 AIC · ⊞ 12.8K · ◷
    Comment /goal to run again

  4. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    Goal run: completed - run

    Branch: goal/496-goal-fix-missing-value-parity-in-real-wasm-rolling-kernels
    PR: #499

    Checkpoint:
    Reconciled publication from the prior run. Verified (via GitHub MCP, read-only) that PR #499 is open against candidate head 7e8bdd7655189d4cc52365ef247b20748a632e66, mergeable_state=clean, and all 8 CI check runs are completed: 7 success (Build, Test & Lint, Build and verify real Wasm, Playground E2E, Validate Python Examples, Reconcile PR 499, Resolve pull requests) and 1 skipped (OpenEvolve benchmark, not a required gate). No code changes were needed this run — the fix and evidence were already committed.

    Evidence:

    • PR [Goal #496] Fix missing-value parity in real Wasm rolling kernels #499 (pull_request_read get): open, draft, base main, head SHA 7e8bdd7655189d4cc52365ef247b20748a632e66, mergeable_state: clean.
    • pull_request_read get_check_runs: 8/8 completed — 7 success, 1 expected skip.
    • pull_request_read get_files: changed files are rust/src/rolling.rs, rebuilt rust/pkg/tsb_wasm* artifacts, and new tests/wasm/parity.test.ts, tests/wasm/fallback-isolated.test.ts, tests/wasm/fallback-check.ts — matching the in-scope fix (no unrelated files touched).
    • Prior run's local evidence (re-confirmed unchanged): cargo test 50/50 passed (8 new regression tests incl. the exact issue reproduction), wasm-pack build from source, bun test tests/wasm/ 71/71 passed (real Wasm-loaded wrapper calls + isolated child-process fallback check), bun test tests/window/ 199/199 passed, bun run typecheck clean, npx biome check 0 new errors.
    • Note: this sandbox has no git/gh network access to github.com (firewall), so verification used the read-only GitHub MCP server instead of local git fetch/gh run list.

    Result:
    completed

    Next:
    None — leaving PR #499 open (draft) for maintainer review/merge, as instructed.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • github.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "github.com"

    See Network Configuration for more information.

    Generated by Goal · copilot · auto · 87.3 AIC · ⌖ 6.47 AIC · ⊞ 12.9K · ◷
    Comment /goal to run again

  5. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    Goal status: completed

    Field Value
    Branch goal/496-goal-fix-missing-value-parity-in-real-wasm-rolling-kernels
    PR #499
    Last Run 2026-09-17
    Run Count 2
    Latest Evidence PR #499 open, mergeable_state=clean, 8/8 CI check runs completed (7 success, 1 expected skip)
    Remaining Work None — awaiting maintainer review/merge

    Summary:
    Fixed a slice_median panic on empty windows (the source of the Wasm unreachable trap) and corrected rolling_min_f64/rolling_max_f64 to seed with Infinity/-Infinity, matching TypeScript fallback semantics for all-missing windows. Added Rust and TypeScript regression/integration tests exercising the real Wasm-loaded wrappers plus an isolated fallback check, rebuilt the Wasm package from source, and confirmed CI green on PR #499's head SHA.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • github.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "github.com"

    See Network Configuration for more information.

    Generated by Goal · copilot · auto · 87.3 AIC · ⌖ 6.47 AIC · ⊞ 12.9K · ◷
    Comment /goal to run again

  6. added
    goal-completedAgentic goal workflow completed this issue
    and removed
    goalAgentic goal workflow should continue working this issue
    on Sep 17, 2026
  7. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    Goal run: completed - run

    Branch: goal/496-goal-fix-missing-value-parity-in-real-wasm-rolling-kernels
    PR: #499

    Checkpoint:
    Reconciled the publication from the previous run. No new code changes were needed this run — verified the already-published fix and CI evidence instead of re-implementing anything.

    Evidence:

    • pull_request_read get_files on PR [Goal #496] Fix missing-value parity in real Wasm rolling kernels #499: changed files are exactly rust/src/rolling.rs, rust/pkg/{tsb_wasm.d.ts,tsb_wasm.js,tsb_wasm_bg.wasm,tsb_wasm_bg.wasm.d.ts}, tests/wasm/{fallback-check.ts,fallback-isolated.test.ts,parity.test.ts} — matches the declared scope, no drift.
    • pull_request_read get_check_runs on PR [Goal #496] Fix missing-value parity in real Wasm rolling kernels #499 head SHA 7e8bdd7655189d4cc52365ef247b20748a632e66: 8/8 check runs completed, all success except one intentionally skipped (OpenEvolve benchmark) — including Test & Lint, Build, Build and verify real Wasm, and Playground E2E (Playwright).
    • actions_list list_workflow_runs filtered on that head SHA: the CI workflow (run 35242801708) and the dedicated Wasm verification workflow (run 35242801522, .github/workflows/wasm-verification.yml) both completed with conclusion: success.
    • These confirm run 1's local evidence (cargo test: 50/50, bun test tests/wasm/: 71/71 including real-Wasm-loaded accelerated wrapper calls and an isolated child-process fallback check, bun test tests/window/: 199/199, clean typecheck/lint) actually reproduced in CI on the published head, not just locally.

    Result:
    completed

    Next:
    None — issue #496's completion contract is satisfied by published, CI-verified evidence. Leaving the branch and PR (#499) open for maintainer review/merge.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • github.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "github.com"

    See Network Configuration for more information.

    Generated by Goal · copilot · auto · 71.8 AIC · ⌖ 9.03 AIC · ⊞ 12.9K · ◷
    Comment /goal to run again

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

    goal-completedAgentic goal workflow completed this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions