Skip to content

Fix minor bugs across api, benchmark, generators, metrics, runners, and other modules#4899

Closed
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D92879402
Closed

Fix minor bugs across api, benchmark, generators, metrics, runners, and other modules#4899
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D92879402

Conversation

@saitcakmak
Copy link
Contributor

Summary:
Fix bugs in smaller modules with 1-2 files each:

  • Client JSON snapshot crash when no GenerationStrategy exists: "generation_strategy" in snapshot is True for the key with a None value, causing a decode crash. Changed to snapshot.get("generation_strategy") is not None (api/client.py:1351)
  • Benchmark ternary discarding input in both branches: {} if target_fidelity_and_task is None else {} always produces an empty dict regardless of input (benchmark/benchmark.py:701)
  • String "False" default (truthy) preventing trials from being marked CANDIDATE: t.run_metadata.get(STARTED_KEY, "False") returns the string "False" which is truthy, so not "False" is always False (runners/map_replay.py:44)
  • Operator precedence making noisy=False set all means to 0.0: item["mean"] + noise if noisy else 0.0 parses as (item["mean"] + noise) if noisy else 0.0, replacing the entire mean with 0.0 when noisy=False (metrics/noisy_function_map.py:86, metrics/branin_map.py:119)
  • Misleading "total number of trials" vs actual trial index (global_stopping/strategies/improvement.py:132) + test update
  • Typos: "trial rial" → "trial" (fb/tutorials/auto_tuning.py), "prefererd" → "preferred" and stray f in f-string (fb/utils/preference/preference.py), "acquistion" → "acquisition" (generators/torch/botorch_modular/utils.py + test)

Differential Revision: D92879402

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 11, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 11, 2026

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

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.83%. Comparing base (ec6b673) to head (3aa7602).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4899      +/-   ##
==========================================
- Coverage   96.84%   96.83%   -0.01%     
==========================================
  Files         596      596              
  Lines       63480    63478       -2     
==========================================
- Hits        61478    61472       -6     
- Misses       2002     2006       +4     

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

…nd other modules (facebook#4899)

Summary:

Fix bugs in smaller modules with 1-2 files each:

- Client JSON snapshot crash when no GenerationStrategy exists: `"generation_strategy" in snapshot` is True for the key with a None value, causing a decode crash. Changed to `snapshot.get("generation_strategy") is not None` (api/client.py:1351)
- Benchmark ternary discarding input in both branches: `{} if target_fidelity_and_task is None else {}` always produces an empty dict regardless of input (benchmark/benchmark.py:701)
- String `"False"` default (truthy) preventing trials from being marked CANDIDATE: `t.run_metadata.get(STARTED_KEY, "False")` returns the string `"False"` which is truthy, so `not "False"` is always False (runners/map_replay.py:44)
- Operator precedence making `noisy=False` set all means to 0.0: `item["mean"] + noise if noisy else 0.0` parses as `(item["mean"] + noise) if noisy else 0.0`, replacing the entire mean with 0.0 when `noisy=False` (metrics/noisy_function_map.py:86, metrics/branin_map.py:119)
- Misleading "total number of trials" vs actual trial index (global_stopping/strategies/improvement.py:132) + test update
- Typos: "trial rial" → "trial" (fb/tutorials/auto_tuning.py), "prefererd" → "preferred" and stray `f` in f-string (fb/utils/preference/preference.py), "acquistion" → "acquisition" (generators/torch/botorch_modular/utils.py + test)

Reviewed By: ItsMrLin

Differential Revision: D92879402
@meta-codesync
Copy link

meta-codesync bot commented Mar 3, 2026

This pull request has been merged in 2c8dbe5.

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.

3 participants