Skip to content

Add arm_name_prefix parameter to make_candidate_trials#5252

Closed
lena-kashtelyan wants to merge 1 commit into
facebook:mainfrom
lena-kashtelyan:export-D110326546
Closed

Add arm_name_prefix parameter to make_candidate_trials#5252
lena-kashtelyan wants to merge 1 commit into
facebook:mainfrom
lena-kashtelyan:export-D110326546

Conversation

@lena-kashtelyan

Copy link
Copy Markdown
Contributor

Summary:
Adds an optional arm_name_prefix parameter to AxBatchClient.make_candidate_trials, plumbed through Experiment.new_batch_trial, BatchTrial, and BaseTrial. When provided, arms generated for the trial are named {arm_name_prefix}_{trial_index}_{arm_index} instead of the default {trial_index}_{arm_index} scheme. Retaining the trial and arm indices keeps arm names unique even when the same prefix is reused across multiple batches (per reviewer feedback), while the prefix makes it easy to identify which scenario a batch of arms was generated for (e.g. max_rev_neutral_engagement_9_4).

The prefix is stored on the trial (_arm_name_prefix) and consumed by BaseTrial._get_default_name, so arms that already carry an explicit name are left untouched. The prefix is ephemeral trial-construction state and is excluded from DB id-copying (COPY_DB_IDS_ATTRS_TO_SKIP).

Reviewed By: mgarrard, eonofrey

Differential Revision: D110326546

Summary:
Adds an optional `arm_name_prefix` parameter to `AxBatchClient.make_candidate_trials`, plumbed through `Experiment.new_batch_trial`, `BatchTrial`, and `BaseTrial`. When provided, arms generated for the trial are named `{arm_name_prefix}_{trial_index}_{arm_index}` instead of the default `{trial_index}_{arm_index}` scheme. Retaining the trial and arm indices keeps arm names unique even when the same prefix is reused across multiple batches (per reviewer feedback), while the prefix makes it easy to identify which scenario a batch of arms was generated for (e.g. `max_rev_neutral_engagement_9_4`).

The prefix is stored on the trial (`_arm_name_prefix`) and consumed by `BaseTrial._get_default_name`, so arms that already carry an explicit name are left untouched. The prefix is ephemeral trial-construction state and is excluded from DB id-copying (`COPY_DB_IDS_ATTRS_TO_SKIP`).

Reviewed By: mgarrard, eonofrey

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

meta-codesync Bot commented Jul 13, 2026

Copy link
Copy Markdown

@lena-kashtelyan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110326546.

@meta-codesync

meta-codesync Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request has been merged in 4f14d60.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5252      +/-   ##
==========================================
- Coverage   96.58%   96.57%   -0.01%     
==========================================
  Files         621      621              
  Lines       70637    70663      +26     
==========================================
+ Hits        68222    68241      +19     
- Misses       2415     2422       +7     

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

2 participants