Skip to content

Preserve multi-metric outcome constraints through candidate generation - #5310

Closed
saitcakmak wants to merge 1 commit into
meta:mainfrom
saitcakmak:export-D126924134
Closed

saitcakmak wants to merge 1 commit into
meta:mainfrom
saitcakmak:export-D126924134

Conversation

@saitcakmak

Copy link
Copy Markdown
Contributor

Summary:
Fixes #5309.

What Changed:

  • Extract all signed coefficients from OutcomeConstraint.metric_weights, without depending on the deprecated ScalarizedOutcomeConstraint class.
  • Validate every fitted constraint metric and compute relative baseline values and diagnostics from every component.
  • Exclude scalarized constraints from automatic single-metric winsorization and avoid nonlinear BilogY transformations of their component metrics, including components that also have single-metric constraints.
  • Reject relative multi-metric expressions in the Client API parser, consistent with the existing documented restriction. Lower-level mixed-sign relative parsing remains a separate issue.
  • Add regression coverage for expression constraints, both inequality directions, signed coefficients, canonical signatures, relative baseline handling, missing component data, and end-to-end Client generation.

The Client reproduction produced A=[[0,1,0]] before the fix. The regression now verifies both appropriately standardized metric coefficients and the transformed bound.

Differential Revision: D126924134

Summary:
Fixes meta#5309.

What Changed:
- Extract all signed coefficients from `OutcomeConstraint.metric_weights`, without depending on the deprecated `ScalarizedOutcomeConstraint` class.
- Validate every fitted constraint metric and compute relative baseline values and diagnostics from every component.
- Exclude scalarized constraints from automatic single-metric winsorization and avoid nonlinear `BilogY` transformations of their component metrics, including components that also have single-metric constraints.
- Reject relative multi-metric expressions in the Client API parser, consistent with the existing documented restriction. Lower-level mixed-sign relative parsing remains a separate issue.
- Add regression coverage for expression constraints, both inequality directions, signed coefficients, canonical signatures, relative baseline handling, missing component data, and end-to-end Client generation.

The Client reproduction produced `A=[[0,1,0]]` before the fix. The regression now verifies both appropriately standardized metric coefficients and the transformed bound.

Differential Revision: D126924134
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 22, 2026
@meta-codesync

meta-codesync Bot commented Oct 22, 2026

Copy link
Copy Markdown

@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126924134.

@meta-codesync

meta-codesync Bot commented Oct 22, 2026

Copy link
Copy Markdown

This pull request has been merged in 4cb6e3e.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.61%. Comparing base (8a07d83) to head (4aeb120).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5310      +/-   ##
==========================================
+ Coverage   96.60%   96.61%   +0.01%     
==========================================
  Files         621      621              
  Lines       71099    71221     +122     
==========================================
+ Hits        68683    68808     +125     
+ Misses       2416     2413       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Multi-metric outcome constraints are silently reduced to a single metric

2 participants