Skip to content

spec(maxpool2d_layer): a lowerable out_side(kernel, stride) for the nn-maxpool widget #10664

Closed as not planned

Description

@gHashTag

Why

gHashTag/trinity#1696 (course 10, neural networks) was refused for one defect (review 5565039954): the widget nn-maxpool hand-holds K_OUT_SIDES = [2, 2, 3, 1]. Those are out_size(4, cfg(k, s)) from specs/ml/layers/maxpool2d_layer.t27, but out_size takes a MaxPool2DConfig struct and does not lower to WASM, so logic.js lists it in __NOT_LOWERED__ and the widget has no compiled way to get the output side.

What

Add a lowerable fn on two integers:

fn out_side(kernel: u32, stride: u32) -> u32 {
    return out_size(4, cfg(kernel, stride));
}

plus tests:

  • the widget's four configs (K_KERNELS = [2, 3, 2, 4], K_STRIDES = [2, 1, 1, 1] on trinity's feat/course-neural-networks): (2,2)->2, (3,1)->2, (2,1)->3, (4,1)->1;
  • edges: a 1 x 1 window keeps the side (1,1)->4; a stride that does not divide rounds down, (3,2)->1 and (1,3)->2.

Done when t27c test-report is all PASS with 0 vacuous, a mutant of the fn goes red, the seal is saved, and t27-logic.mjs lists outSide among the lowered fns.

Not here: re-vendoring into trinity, calling outSide(k, st) in tool.js and dropping K_OUT_SIDES (a later step on trinity#1696).

Boundary

  • specs/ml/layers/maxpool2d_layer.t27
  • .trinity/seals/Maxpool2d.json, .trinity/seals/layers_Maxpool2d.json (its seal files)
  • docs/now/2026-10-18-maxpool-out-side.md (NOW entry)

Parent: #9063

Activity

  1. added
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 18, 2026
  2. github-actions commented on Oct 18, 2026

    @github-actions
    Contributor

    Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.

    • missing: ## User Scenarios -- at least one Given/When/Then scenario
    • missing: ## Requirements -- numbered obligations, FR-001: ... MUST ...
    • missing: ## Success Criteria -- an outcome a machine can settle: a number with a unit, a backticked file, exit 0, or a backticked command
  3. added a commit that references this issue on Oct 18, 2026
    2e53089
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

    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions