Skip to content

Blinding groups and full-name parameter matching#144

Merged
davidwalter2 merged 3 commits into
WMass:mainfrom
lucalavezzo:blinding-groups
Jun 22, 2026
Merged

Blinding groups and full-name parameter matching#144
davidwalter2 merged 3 commits into
WMass:mainfrom
lucalavezzo:blinding-groups

Conversation

@lucalavezzo

Copy link
Copy Markdown
Collaborator

Split out of #139 as a standalone feature (no dependency on the priors work).

--blindingGroup

Regex-defined groups of parameters that share a single deterministic blinding offset, seeded from the group regex string itself. This keeps relative pulls / differences between matched parameters meaningful while still blinding their absolute values, e.g. --blindingGroup '^alphaS_y\d+$' applies one common offset to all αS rapidity-bin parameters. Parameters not matching any group keep per-name blinding. A parameter matching both --unblind and --blindingGroup is a configuration error and aborts the fit, to avoid silently picking one interpretation.

Full-name parameter matching

match_regexp_params now matches each expression against the full parameter name (re.fullmatch) and returns the union of exact and regex matches (de-duplicated, order-preserving) instead of short-circuiting on the first exact match.

Behavior change: full anchoring means an expression that names one parameter exactly can no longer also match parameters whose names merely extend it — a prefix match could silently unblind more than intended. Match a family with an explicit pattern, e.g. 'alphaS.*'. The parameters an --unblind expression resolves to are now logged at INFO. Used by --unblind, --freezeParameters, and --blindingGroup; help texts updated.

Tests

Existing suite passes (15). Verified by hand on the test tensor: group members share one offset; an --unblind/--blindingGroup overlap aborts with a clear error.

🤖 Generated with Claude Code

--blindingGroup: regex-defined groups of parameters that share a single
deterministic blinding offset, seeded from the group regex string itself.
This keeps relative pulls / differences between matched parameters
meaningful while still blinding their absolute values (e.g.
--blindingGroup '^alphaS_y\d+$' applies one common offset to all alphaS
rapidity-bin parameters). Parameters not matching any group keep per-name
blinding. A parameter matching both --unblind and --blindingGroup is a
configuration error and aborts the fit, to avoid silently picking one
interpretation.

match_regexp_params now matches each expression against the FULL parameter
name (re.fullmatch) and returns the union of exact and regex matches
(de-duplicated, order-preserving) instead of short-circuiting on the first
exact match. Full anchoring means an expression naming one parameter
exactly can no longer also match parameters whose names merely extend it
(a prefix match could silently unblind more than intended); match a family
with an explicit pattern, e.g. 'alphaS.*'. The parameters an --unblind
expression resolves to are now logged at INFO. Used by --unblind,
--freezeParameters and --blindingGroup; help texts updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lucalavezzo and others added 2 commits June 22, 2026 16:34
test_global_asym_impacts.py wrote to a fixed /tmp/test_global_asym_impacts
path, so two CI runs touching it at the same time (e.g. several open PRs)
clobbered each other's intermediate fit results -> spurious FileNotFound.
Derive OUTDIR from the per-run RABBIT_OUTDIR (a unique uuid dir in CI),
falling back to a fresh tempfile.mkdtemp() locally. It is the only test
with a hardcoded shared output path; the fit CI jobs already use
RABBIT_OUTDIR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Removed comments about output directory handling in CI.
@davidwalter2 davidwalter2 merged commit 1aa4ecf into WMass:main Jun 22, 2026
52 of 65 checks passed
lucalavezzo added a commit to lucalavezzo/rabbit that referenced this pull request Jun 23, 2026
Integrates the merged sibling PRs into the priors/unification branch:
  WMass#140 fit-ops (minimizer flags, externalPostfit), WMass#142 scalePoiScan,
  WMass#143 CompositeParamModel layout fix, WMass#144 blinding groups.

Conflicts (both trivial):
  - fitter.py: blinding_group=options.blindingGroup (main's direct form;
    the SimpleNamespace test fixtures already carry blindingGroup=[]).
  - helpers.py: kept main's cleaned-up version (dropped the explanatory
    comment removed on main).
Also dropped tests/test_composite_param_model.py, which the merge
re-introduced from this branch but was deliberately removed on main.

Validated: lint clean; pytest (15) + the five CI script-tests pass; the
ParamModel-prior closure is unchanged (gaussian sig_prior 1.105769e-02,
asym (-1.097e-2,+1.114e-2)); parsing.py is identical to main so all of
WMass#140/WMass#142/WMass#144's CLAs are present.

Co-Authored-By: Claude Fable 5 <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.

2 participants