Skip to content

Include SQ arm in DerivedMetric output when relativize_inputs=True (#5029)#5029

Closed
ItsMrLin wants to merge 1 commit into
facebook:mainfrom
ItsMrLin:export-D96558255
Closed

Include SQ arm in DerivedMetric output when relativize_inputs=True (#5029)#5029
ItsMrLin wants to merge 1 commit into
facebook:mainfrom
ItsMrLin:export-D96558255

Conversation

@ItsMrLin
Copy link
Copy Markdown
Contributor

@ItsMrLin ItsMrLin commented Mar 14, 2026

Summary:

When relativize_inputs=True, the status quo arm was previously excluded
from the output because its relativized values are trivially zero. This
is incorrect for non-linear expressions: exp(0) = 1, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let _compute_derived_values evaluate
the expression on them. This produces correct SQ output for any
expression (e.g., a + b = 0, exp(a) = 1).

Reviewed By: Balandat

Differential Revision: D96558255

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 14, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Mar 14, 2026

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.84%. Comparing base (f3fd499) to head (57808d0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5029      +/-   ##
==========================================
- Coverage   96.84%   96.84%   -0.01%     
==========================================
  Files         605      605              
  Lines       65292    65313      +21     
==========================================
+ Hits        63233    63252      +19     
- Misses       2059     2061       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@meta-codesync meta-codesync Bot changed the title Include SQ arm in DerivedMetric output when relativize_inputs=True Include SQ arm in DerivedMetric output when relativize_inputs=True (#5029) Mar 14, 2026
ItsMrLin added a commit to ItsMrLin/Ax that referenced this pull request Mar 14, 2026
…acebook#5029)

Summary:

When `relativize_inputs=True`, the status quo arm was previously excluded
from the output because its relativized values are trivially zero.  This
is incorrect for non-linear expressions: `exp(0) = 1`, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let `_compute_derived_values` evaluate
the expression on them.  This produces correct SQ output for any
expression (e.g., `a + b = 0`, `exp(a) = 1`).

Differential Revision: D96558255
ItsMrLin added a commit to ItsMrLin/Ax that referenced this pull request Mar 14, 2026
…acebook#5029)

Summary:
Pull Request resolved: facebook#5029

When `relativize_inputs=True`, the status quo arm was previously excluded
from the output because its relativized values are trivially zero.  This
is incorrect for non-linear expressions: `exp(0) = 1`, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let `_compute_derived_values` evaluate
the expression on them.  This produces correct SQ output for any
expression (e.g., `a + b = 0`, `exp(a) = 1`).

Differential Revision: D96558255
ItsMrLin added a commit to ItsMrLin/Ax that referenced this pull request Mar 15, 2026
…acebook#5029)

Summary:

When `relativize_inputs=True`, the status quo arm was previously excluded
from the output because its relativized values are trivially zero.  This
is incorrect for non-linear expressions: `exp(0) = 1`, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let `_compute_derived_values` evaluate
the expression on them.  This produces correct SQ output for any
expression (e.g., `a + b = 0`, `exp(a) = 1`).

Reviewed By: Balandat

Differential Revision: D96558255
…acebook#5029)

Summary:
Pull Request resolved: facebook#5029

When `relativize_inputs=True`, the status quo arm was previously excluded
from the output because its relativized values are trivially zero.  This
is incorrect for non-linear expressions: `exp(0) = 1`, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let `_compute_derived_values` evaluate
the expression on them.  This produces correct SQ output for any
expression (e.g., `a + b = 0`, `exp(a) = 1`).

Reviewed By: Balandat

Differential Revision: D96558255
ItsMrLin added a commit to ItsMrLin/Ax that referenced this pull request Mar 15, 2026
…acebook#5029)

Summary:

When `relativize_inputs=True`, the status quo arm was previously excluded
from the output because its relativized values are trivially zero.  This
is incorrect for non-linear expressions: `exp(0) = 1`, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let `_compute_derived_values` evaluate
the expression on them.  This produces correct SQ output for any
expression (e.g., `a + b = 0`, `exp(a) = 1`).

Reviewed By: Balandat

Differential Revision: D96558255
ItsMrLin added a commit to ItsMrLin/Ax that referenced this pull request Mar 15, 2026
…acebook#5029)

Summary:

When `relativize_inputs=True`, the status quo arm was previously excluded
from the output because its relativized values are trivially zero.  This
is incorrect for non-linear expressions: `exp(0) = 1`, not 0.

Instead of skipping the SQ arm, construct a DataFrame with zero-valued
inputs for all input metrics and let `_compute_derived_values` evaluate
the expression on them.  This produces correct SQ output for any
expression (e.g., `a + b = 0`, `exp(a) = 1`).

Reviewed By: Balandat

Differential Revision: D96558255
@meta-codesync meta-codesync Bot closed this in 4c1ed83 Mar 15, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Mar 15, 2026

This pull request has been merged in 4c1ed83.

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. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants