Repository navigation
1RM: seven-formula estimation suite with RIR handling, weighting, and accuracy index (#155) - #195
Open
giulioleuci wants to merge 2 commits into
Open
giulioleuci wants to merge 2 commits into
giulioleuci wants to merge 2 commits into
Conversation
Contributor
Author
|
Implement #155 |
giulioleuci
force-pushed
the
feat/multi-formula-1rm-issue-155
branch
from
September 28, 2026 12:57
ad92e94 to
d5cc05b
Compare
Owner
|
Thanks for this! Since it touches the 1RM estimate that the fatigue model and progression read, I'll review it together with the new progression engine (#312, milestone v1.3.12) rather than on its own. It will need a rebase onto v1.3.9 (https://github.com/DuarteSantos8/openGym/releases/tag/v1.3.9). |
…g, and accuracy index (DuarteSantos8#155) Extend the 1RM module for issue DuarteSantos8#155 (milestone v1.3.12): - Formula suite: keep Epley, Brzycki, Lombardi; add O'Connor, Mayhew, Wathan, Lander. - RIR handling: optional rir param; effectiveReps = reps + rir against a Mike Tuchscherer (RTS) %1RM map; the estimate weight / (%1RM / 100) joins the weighted ensemble. - Weight matrix: per-formula absolute reliability x variable rep attenuation, replacing the flat rep-based cutoff. Weighted ensemble capped at WEIGHTED_REP_CAP (15); single formulas keep REP_CAP (12). - calculate1RMAccuracy(reps, rir, formula): 0-1 confidence index from rep decay, RIR subjectivity, and inter-formula spread. - Backward compatible estimate1RM(w, r, formula, rir); 1 rep with RIR 0 returns the load exactly. recovery.js: the fatigue model's session-local 1RM anchor now uses the onerm weighted mean instead of a hand-rolled Epley clamp; sets beyond WEIGHTED_REP_CAP form no anchor and count as unweighted raw stimulus.
- useStore.media: the sign-out purge keeps any file put at or after the sign-out's own start, so a file put in the same millisecond was kept for good and the wait for its removal could never end. Pause 5 ms after the put, as the sibling test does. - CoachChat.demo-failure: the demo is imported on first use, a cold load is file I/O, and the test waited twenty microtasks for it. Load it before the click. - server-password: only sign-ins already running when the password changes are the subject; one that starts after it is a wrong password, and five pause the account for a minute, so the final sign-in got 429 whenever the loop outlasted the change. Stop starting new ones once it is done. - server-media: the server writes the log line before it replies, but the test reads the two on separate pipes. Wait for the line instead of reading it once. Each was reproduced first (the media and password ones under CPU load) and fails without its fix. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4o3WJxPtaibivEfhLvwAR
giulioleuci
force-pushed
the
feat/multi-formula-1rm-issue-155
branch
from
October 4, 2026 10:54
e669c89 to
1049b86
Compare
Contributor
Author
|
Hi @DuarteSantos8 , I rebased my branch. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #155 (milestone v1.3.12): extends the estimated-1RM module with a seven-formula suite, RIR-aware estimation, a formula weight matrix, a confidence index — and routes the fatigue model through the same estimate.
What changed
frontend/src/lib/onerm.jsFormula suite. Keeps Epley, Brzycki and Lombardi; adds O'Connor, Mayhew, Wathan and Lander in a single
FORMULASmap.RIR handling. The
estimate1RM(w, r, formula, rir)signature gains an optionalrirparameter. Effective reps (reps + rir) are read against a Mike Tuchscherer / RTS%1RMmap, and the RIR-based estimateweight / (%1RM / 100)participates in the weighted ensemble.Weight matrix. The flat rep-based cutoff is replaced by a two-tier per-formula weighting: an absolute reliability factor
a_imultiplied by a variable rep attenuationv_i(r)(weight_i = a_i * v_i(r)). E.g. Brzycki decays rapidly past 8 reps, Epley overestimates past 6, the RIR map loses accuracy past 10.Weighted estimate. A new
weightedformula blends all seven formulas (plus the RIR map when RIR is present), capped at the newWEIGHTED_REP_CAP = 15; individual formulas keepREP_CAP = 12.weightedEstimate()is exported unrounded for internal consumers.Accuracy index.
calculate1RMAccuracy(reps, rir, formula)returns a 0–1 confidence index combining:WEIGHTED_REP_CAP),rir > 0— RIR 0 is an objective to-failure set),weightedformula).Backward compatibility. Existing callers are unaffected; a single rep still returns the measurement unchanged, and
r === 1, rir === 0returns the load exactly.frontend/src/lib/recovery.jsThe fatigue model's session-local 1RM anchor now uses the onerm weighted mean instead of a hand-rolled Epley clamp (removed the duplicated formula and rep cap). The unrounded blend keeps kg↔lb equivalence and the causal-reference math exact. Sets beyond
WEIGHTED_REP_CAPform no anchor and register as unweighted raw stimulus — honest rather than scaled by a fantasy 1RM.Tests
frontend/src/lib/onerm.test.jsgains coverage for the new formulas, the weighted estimate, RIR cases, and the accuracy index;recovery.test.jsfixtures now derive from the weighted anchor instead of hardcoded Epley intensity. Full frontend suite: 1492 tests passing.