Skip to content

Adapter.gen: store untransformed optimization config on GeneratorRun (#5228)#5228

Closed
eonofrey wants to merge 1 commit into
facebook:mainfrom
eonofrey:export-D107967197
Closed

Adapter.gen: store untransformed optimization config on GeneratorRun (#5228)#5228
eonofrey wants to merge 1 commit into
facebook:mainfrom
eonofrey:export-D107967197

Conversation

@eonofrey

@eonofrey eonofrey commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary:

ObjectiveAsConstraint adds a constraint on the objective metric when no observed points are feasible, producing a single-objective OptimizationConfig that breaks its own invariant
(constructible only because the transform mutates _outcome_constraints directly). Adapter.gen then re-cloned that config via clone_with_args to store on the GeneratorRun, and validation raised ValueError: Cannot constrain on objective metric..

Fix: store the untransformed, user-space config on the GeneratorRun (like orig_search_space already is) — it's the correct thing to record and is always valid.

Surfaced in SPORE/QRT notebooks when swapping objective/constraint metrics, but really triggers for any config whose constraint excludes all observed points.

{F1990966498}

Differential Revision: D107967197

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jun 9, 2026
@meta-codesync

meta-codesync Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

…acebook#5228)

Summary:

ObjectiveAsConstraint adds a constraint on the objective metric when no observed points are feasible, producing a single-objective OptimizationConfig that breaks its own invariant
(constructible only because the transform mutates _outcome_constraints directly). Adapter.gen then re-cloned that config via clone_with_args to store on the GeneratorRun, and validation raised ValueError: Cannot constrain on objective metric..

Fix: store the untransformed, user-space config on the GeneratorRun (like orig_search_space already is) — it's the correct thing to record and is always valid.

Surfaced in SPORE/QRT notebooks when swapping objective/constraint metrics, but really triggers for any config whose constraint excludes all observed points.

 {F1990966498}

Differential Revision: D107967197
@meta-codesync meta-codesync Bot changed the title Adapter.gen: store untransformed optimization config on GeneratorRun Adapter.gen: store untransformed optimization config on GeneratorRun (#5228) Jun 9, 2026
@eonofrey eonofrey force-pushed the export-D107967197 branch from 3994e45 to f790c56 Compare June 9, 2026 16:21
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.56%. Comparing base (5ddbac2) to head (f790c56).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5228   +/-   ##
=======================================
  Coverage   96.56%   96.56%           
=======================================
  Files         619      619           
  Lines       70143    70160   +17     
=======================================
+ Hits        67731    67748   +17     
  Misses       2412     2412           

☔ 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.

@meta-codesync

meta-codesync Bot commented Jun 9, 2026

Copy link
Copy Markdown

This pull request has been merged in a3a17f2.

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.

2 participants