Skip to content

Newton appears to start one iteration late (0- vs 1-based newt_start) #335

Closed

Description

@neuromechanist

Found during epic #324 (component-orientation investigation); needs confirmation before the fix.

Symptom

pamica appears to switch Newton on one iteration later than the reference. pamica compares a 0-based iteration index with >= newt_start (torch _update_parameters, NumPy _update_parameters, MLX _update_parameters), while the reference compares its 1-based iter .ge. newt_start. With the row-layout prototype and doscaling on, running pamica with newt_start=49 against the reference's newt_start=50 cut the maximum 100-iteration LL deviation from 1.3e-3 to 7.2e-6 (the reference's own OpenMP run-to-run noise is about 1e-6).

To do (epic #324 Phase 9)

  • Confirm the off-by-one on every newt_start-gated site (Newton switch, the newt_ramp lrate ramp, the rholrate ceiling ratchet iter > newt_start, and any other 1-based schedule such as share_start, kurt_start, rejstart) against amica15.f90, backend by backend.
  • Fix all three backends identically, with a gated native-oracle test on the first Newton iterations and an always-on test of the schedule arithmetic.
  • Record any schedule that deliberately stays different in docs/guides/amica-differences.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions