Skip to content

Add coeff_ops + presolve_ops instrumentation (PRIME mode)#3

Open
thibautbar wants to merge 2 commits into
mainfrom
add-coeff-ops-counter
Open

Add coeff_ops + presolve_ops instrumentation (PRIME mode)#3
thibautbar wants to merge 2 commits into
mainfrom
add-coeff-ops-counter

Conversation

@thibautbar

Copy link
Copy Markdown
Owner

Counts modular coefficient operations so feynman-bench can report a num_ops metric per reduction:

  • coeff_ops: monomial-level ops in the Laporta substitution kernel (add_to)
  • presolve_ops: ops in the presolve (add_ibps) Both are per-sector atomics persisted to the kyotocabinet DB and summed in the master, printed as "Coeff ops:", "Presolve ops:", "Total ops:" in the STATISTICS block. The presolve aggregation is gated on Common::one_pass in the second scan_snapshot lambda to avoid double-counting in non-one_pass mode.

thibautbar and others added 2 commits May 27, 2026 10:57
Counts modular coefficient operations so feynman-bench can report a
num_ops metric per reduction:
- coeff_ops: monomial-level ops in the Laporta substitution kernel (add_to)
- presolve_ops: ops in the presolve (add_ibps)
Both are per-sector atomics persisted to the kyotocabinet DB and summed in
the master, printed as "Coeff ops:", "Presolve ops:", "Total ops:" in the
STATISTICS block. The presolve aggregation is gated on Common::one_pass in
the second scan_snapshot lambda to avoid double-counting in non-one_pass mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two fixes to make Total ops an honest count of modular multiplicative ops:
- presolve_ops: each add_ibps outer iteration does (dim+1) coefficient
  multiplications per single-equation branch and 2*(dim+1) for the
  both-equations branch, not 1. Bump accordingly instead of once per iter.
- div_ops (new): count modular inversions (nmod_div / nmod_inv via operator/),
  one per pivot coefficient computation. The trailing multiply of a division
  is left uncounted, symmetric with FIRE 6's mul_inv.
Total ops = coeff_ops + presolve_ops + div_ops, printed in STATISTICS and
persisted per-sector (keys ops_prs / ops_div) for master aggregation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant