Skip to content

Commit 474f935

Browse files
Jack Fengmeta-codesync[bot]
authored andcommitted
Add scope to determine whether packing param resolver should be used
Summary: Previously in D91112051, we removed `is_target_repo_in_scope_for_packing`, we are basically bringing back the support for it again in this diff. I didn't do it in D91112051 because the code changes was easier to make on top of the registry we have. Also, previously, `is_target_repo_in_scope_for_packing` the name implies it check whether the current context is in scope for packing, when I bring it back within `PackingParamResolver`, the "in_scope" now represents whether the config and qe should be used, when in_scope, both are used, and when not, neither are used, just return code default. The way this works is, whenever we try to get a `TdPackingParamResolver` or `GroupPackingParamResolver`, we check if we are in scope, if yes, we returned corresponding resolver, if not we return `None`, which when passed to params from registry, e.g., `param_registry::bool::ENABLE_CANONICAL_FEATURES.get_value(None)`, will skip value look up from both config and qe, and will go ahead return the code default. … +17 lines (ctrl+o to expand) ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● Now I can see the stack clearly. Let me get the full stack and find the bottom diff. ● Bash(cd /data/users/huadongfeng/fbsource && sl smartlog 2>/dev/null | head -80) ⎿ o changeset: fff348c57782a4a6d490a0d9aafab696a948410e D91761411 ╷ user: generatedunixname89002005316268 <generatedunixname89002005316268@meta.com> ╷ date: Thu, 29 Jan 2026 01:31:35 -0800 … +77 lines (ctrl+o to expand) ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● Now I have a clear picture of the stack: Stack Structure: - Top of stack (current @): D91761617 - c5fca2ec3562 - "[packing] in scope packing" - Bottom of stack: D90883064 - 6f9a3e165f3c - "[packing] Sync thrift and loading the new Inner/Outer packing config in Rust" The stack has 8 commits from D90883064 to D91761617 (plus D91643415 above current). Now let me check the backtest_scheduler help to see how to pass the TD projects, then proceed with the builds. ● Bash(cd /data/users/huadongfeng/fbsource/fbcode && buck2 run --reuse-current-config fbcode//target_determinator/backtest_scheduler:backtest_scheduler -- --help 2>&1…) ⎿ [2026-01-29T01:38:23.664-08:00] Buck UI: https://www.internalfb.com/buck2/1dcc985a-9c87-4e4c-b11b-c0fc7d3ae92c [2026-01-29T01:38:24.537-08:00] File changed: fbcode//target_determinator/scheduler/src/laser/target_feature.rs [2026-01-29T01:38:24.537-08:00] File changed: fbcode//target_determinator/scheduler/src/packing/param_registry.rs … +49 lines (ctrl+o to expand) ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● I now have all the information I need. Here's my execution plan: Execution Plan ┌──────┬──────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Step │ Action │ Details │ ├──────┼──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 1 │ Build supertd (top) │ buck2 build fbcode//mode/opt fbcode//target_determinator/supertd:supertd --out ~/local/supertd_D91761617 │ ├──────┼──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 2 │ Checkout bottom │ sl goto 6f9a3e165f3c (D90883064) │ ├──────┼──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 3 │ Build supertd (base) │ buck2 build fbcode//mode/opt fbcode//target_determinator/supertd:supertd --out ~/local/supertd_base_D90883064 │ ├──────┼──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 4 │ Return to top │ sl goto c5fca2ec3562 (D91761617) │ ├──────┼──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 5 │ Build skycastle │ buck2 build fbcode//mode/opt fbcode//skycastle:skycastle_linux --out ~/local/skycastle │ ├──────┼──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 6 │ Run backtest │ With --td-project fbcode --td-project genai --td-project rl --td-project xplat │ └──────┴──────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Let me start executing. First, build supertd at the top of the stack. ● Bash(cd /data/users/huadongfeng/fbsource/fbcode && buck2 build fbcode//mode/opt fbcode//target_determinator/supertd:supertd --out timeout: 10m ~/local/supertd_D91761617 2>&1) 0s ⎿ [2026-01-29T01:38:35.525-08:00] Buck UI: https://www.internalfb.com/buck2/92db63d3-57ef-4d0f-99ad-6fc409fe8d99 [2026-01-29T01:38:36.124-08:00] RE Session: reSessionID-21108e3d-128e-4092-996e-a3db3bc634b7 [2026-01-29T01:38:43.220-08:00] Waiting on fbcode//target_determinator/supertd:supertd (cfg:opt-linux-x86_64-fbcode-platform010-clang19-no-san#f420 … +15 lines (ctrl+o to expand) ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● Top of stack supertd built. Now checkout the bottom of the stack and build there. ● Bash(cd /data/users/huadongfeng/fbsource && sl goto 6f9a3e165f3c 2>&1) timeout: 1m 0s ⎿ update complete ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● Bash(cd /data/users/huadongfeng/fbsource/fbcode && buck2 build fbcode//mode/opt fbcode//target_determinator/supertd:supertd --out timeout: 10m 0s ~/local/supertd_base_D90883064 2>&…) ⎿ [2026-01-29T01:39:36.712-08:00] Buck UI: https://www.internalfb.com/buck2/47efdb76-68a1-4a9b-9277-c308d54c7f8c [2026-01-29T01:39:37.605-08:00] File changed: fbcode//target_determinator/scheduler/src/laser/target_feature.rs [2026-01-29T01:39:37.605-08:00] File changed: fbcode//target_determinator/scheduler/src/packing/mod.rs … +17 lines (ctrl+o to expand) ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● Both supertd binaries built. Now let me return to the top of the stack and build skycastle. ● Bash(cd /data/users/huadongfeng/fbsource && sl goto c5fca2ec3562 2>&1) timeout: 1m 0s ⎿ update complete ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● Bash(cd /data/users/huadongfeng/fbsource/fbcode && buck2 build fbcode//mode/opt fbcode//skycastle:skycastle_linux --out ~/local/skycastle timeout: 10m 2>&1) 0s ⎿ [2026-01-29T01:40:28.683-08:00] Buck UI: https://www.internalfb.com/buck2/8c8c0f74-2959-4ee9-a018-0456e8499a26 [2026-01-29T01:40:29.513-08:00] File changed: fbcode//target_determinator/scheduler/src/laser/target_feature.rs [2026-01-29T01:40:29.513-08:00] File changed: fbcode//target_determinator/scheduler/src/packing/mod.rs … +27 lines (ctrl+o to expand) ⎿ Shell cwd was reset to /data/users/huadongfeng/fbsource/fbcode/target_determinator ● All binaries are built. Let me verify the builds and then run the backtest with the specified TD projects. ● Bash(ls -la ~/local/supertd_D91761617 ~/local/supertd_base_D90883064 ~/local/skycastle 2>&1) ⎿ -rwxr-xr-x 1 huadongfeng users 586227712 Jan 29 01:41 /home/huadongfeng/local/skycastle -rwxr-xr-x 1 huadongfeng users 2088346568 Jan 29 01:40 /home/huadongfeng/local/supertd_base_D90883064 -rwxr-xr-x 1 huadongfeng users 2088526656 Jan 29 01:39 /home/huadongfeng/local/supertd_D91761617 ● All binaries are ready. Now running the backtest with the specified TD projects (fbcode, genai, rl, xplat). ● Bash(cd /data/users/huadongfeng/fbsource/fbcode && buck2 run --reuse-current-config timeout: 10m fbcode//target_determinator/backtest_scheduler:backtest_scheduler -- \ 0s -1 ~/loc…) ⎿ Running in the background (↓ to manage) ● The backtest is running in the background. Let me check its progress. ● Bash(tail -100 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +20 lines (ctrl+o to expand) ● The backtest is running and found 1471 workflow runs across the 4 TD projects. Let me wait and check progress periodically. ● Bash(sleep 30 && tail -50 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) timeout: 1m 0s ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +20 lines (ctrl+o to expand) ● Bash(sleep 60 && tail -100 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +20 lines (ctrl+o to expand) ● Still downloading. Let me check again with a longer wait. ● Bash(sleep 120 && tail -150 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) timeout: 3m 0s ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +20 lines (ctrl+o to expand) ● The download is taking a while with 1471 workflow runs. Let me check if the process is still running and wait longer. ● Bash(ps aux | grep backtest_scheduler | grep -v grep | head -5) ⎿ huadong+ 152154 0.0 0.0 7408 3240 ? Ss 01:41 0:00 /bin/bash -c -l source /home/huadongfeng/.claude/shell-snapshots/snapshot-bash-1 769679468910-gcodlu.sh && shopt -u extglob 2>/dev/null || true && eval 'cd /data/users/huadongfeng/fbsource/fbcode && buck2 run --reuse-current-con fig fbcode//target_determinator/backtest_scheduler:backtest_scheduler -- \ -1 ~/local/supertd_base_D90883064 \ -2 ~/local/supertd_D91761617 \ … +10 lines (ctrl+o to expand) ● The process is still running. Let me wait longer and check again. ● Bash(sleep 180 && tail -200 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) timeout: 4m 0s ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +20 lines (ctrl+o to expand) ● Bash(wc -l /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output && ps aux | grep backtest_scheduler | grep -v grep | wc -l) ⎿ 23 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 3 ● The process is still running (3 processes) with output still at 23 lines. The skycastle downloads are likely happening concurrently. Let me wait longer. ● Bash(sleep 300 && tail -200 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) timeout: 6m 0s ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +20 lines (ctrl+o to expand) ● Bash(ps aux | grep -E "skycastle|backtest" | grep -v grep | head -20) ⎿ huadong+ 152154 0.0 0.0 7408 3240 ? Ss 01:41 0:00 /bin/bash -c -l source /home/huadongfeng/.claude/shell-snapshots/snapshot-bash-1 769679468910-gcodlu.sh && shopt -u extglob 2>/dev/null || true && eval 'cd /data/users/huadongfeng/fbsource/fbcode && buck2 run --reuse-current-con fig fbcode//target_determinator/backtest_scheduler:backtest_scheduler -- \ -1 ~/local/supertd_base_D90883064 \ -2 ~/local/supertd_D91761617 \ … +72 lines (ctrl+o to expand) ● Skycastle is actively downloading workflow runs (I can see multiple concurrent downloads happening). The process is working. Let me wait longer and check the download directory to see progress. ● Bash(ls /tmp/backtest__36jbsfc/inputs 2>/dev/null | wc -l) ⎿ 1063 ● Good progress - 1063 out of 1471 inputs downloaded (~72%). Let me wait a bit more. ● Bash(sleep 120 && ls /tmp/backtest__36jbsfc/inputs 2>/dev/null | wc -l) timeout: 3m 0s ⎿ 1184 ● Bash(sleep 120 && ls /tmp/backtest__36jbsfc/inputs 2>/dev/null | wc -l && tail -100 timeout: 3m 0s /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bed…) ⎿ 1302 [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B … +21 lines (ctrl+o to expand) ● Progress continues - 1302/1471 (~89%). Let me wait for the download to complete. ● Bash(sleep 180 && ls /tmp/backtest__36jbsfc/inputs 2>/dev/null | wc -l && tail -200 timeout: 4m 0s /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bed…) ⎿ 1471 [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B … +21 lines (ctrl+o to expand) ● All 1471 inputs downloaded. The backtest should now be running the scheduler comparisons. Let me check the output. ● Bash(tail -300 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +22 lines (ctrl+o to expand) ● Downloads complete - now running the scheduler binaries on all 1471 inputs. This phase runs the two supertd binaries on each input to compare outputs. Let me monitor this. ● Bash(sleep 120 && tail -50 /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/bedcb9c.output 2>&1) timeout: 3m 0s ⎿ [2026-01-29T01:41:42.444-08:00] Buck UI: https://www.internalfb.com/buck2/2046344e-56b3-4450-bdcf-5119a1402d03 [2026-01-29T01:41:42.450-08:00] Network: Up: 0B Down: 0B BUILD SUCCEEDED - starting your binary … +22 lines (ctrl+o to expand) ● Bash(ps aux | grep supertd | grep -v grep | head -10) ⎿ huadong+ 152154 0.0 0.0 7408 3240 ? Ss 01:41 0:00 /bin/bash -c -l source /home/huadongfeng/.claude/shell-snapshots/snapshot-bash-1 769679468910-gcodlu.sh && shopt -u extglob 2>/dev/null || true && eval 'cd /data/users/huadongfeng/fbsource/fbcode && buck2 run --reuse-current-con fig fbcode//target_determinator/backtest_scheduler:backtest_scheduler -- \ -1 ~/local/supertd_base_D90883064 \ -2 ~/local/supertd_D91761617 \ … +45 lines (ctrl+o to expand) ● The scheduler comparison runs are in progress. I can see both binaries (supertd_base_D90883064 and supertd_D91761617) running in parallel on multiple inputs from xplat and genai projects. Let me check the output count to gauge progress. ● Bash(ls /tmp/backtest__36jbsfc/outputs 2>/dev/null | wc -l) ⎿ 520 ● 520/1471 outputs processed (~35%). Let me wait longer for the backtest to complete. ● Bash(sleep 300 && ls /tmp/backtest__36jbsfc/outputs 2>/dev/null | wc -l && tail -100 timeout: 6m 0s /tmp/claude/-data-users-huadongfeng-fbsource-fbcode-target-determinator/tasks/be…) ⎿ 1416 2026-01-29 01:41:42 [INFO] Output directory: /tmp/backtest__36jbsfc 2026-01-29 01:41:42 [INFO] Skip fetch: False … +98 lines (ctrl+o to expand) ● The backtest is complete. Let me read the summary and examine a few of the differences. ● Read(/tmp/backtest__36jbsfc/outputs/summary.txt) ⎿ Read 150 lines ● Bash(head -100 /tmp/backtest__36jbsfc/outputs/2918332558549367583/comparison/diff.txt 2>&1) ⎿ ===== Comparison for workflow run: 2918332558549367583 ===== Hash: 6cfa28a6665fe1ad16ad204487417b68d4aaf2db PVN: 336685915 … +97 lines (ctrl+o to expand) ● Now I have a clear picture. Let me look at a few more diffs to understand the pattern better. ● Bash(head -50 /tmp/backtest__36jbsfc/outputs/3701958893711896070/comparison/diff.txt 2>&1) ⎿ ===== Comparison for workflow run: 3701958893711896070 ===== Hash: 3d4e5a8f2102800bf5d6291fa4a57125685ec085 PVN: 336684664 … +47 lines (ctrl+o to expand) ● The pattern is clear. Let me summarize the results. --- Backtest Results Summary Configuration - Stack: D90883064 (bottom/baseline) → D91761617 (top/comparison) - TD Projects tested: fbcode, genai, rl, xplat - Workflow runs: 1471 found, 1415 processed (56 likely failed/skipped) - Results directory: /tmp/backtest__36jbsfc Results ┌────────────────────────┬──────────────┐ │ Metric │ Count │ ├────────────────────────┼──────────────┤ │ Total inputs processed │ 1415 │ ├────────────────────────┼──────────────┤ │ Identical results │ 1346 (95.1%) │ ├────────────────────────┼──────────────┤ │ Differences found │ 69 (4.9%) │ └────────────────────────┴──────────────┘ Analysis of Differences The differences are consistent across all 69 runs and relate to packing/sizing parameters: 1. citadel_sizer property change: - Baseline (D90883064): 'xgboost_calibrated' - New (D91761617): 'weight' 2. unicastle_size property change (in some cases): - Baseline: 'I3_SMALL|I4_SMALL' - New: 'I3_SMALLPLUSPLUS|I4_SMALLPLUSPLUS|I6_SMALLPLUSPLUS|I7_SMALLPLUSPLUS' Interpretation This is an expected behavioral change consistent with the stack's purpose ("[packing]" changes). Your stack introduces: 1. A new packing parameter registry and resolver system 2. Changes to how sizer strategies are selected - moving from xgboost_calibrated to weight-based sizing 3. Updates to machine size recommendations (using SMALLPLUSPLUS variants instead of SMALL) Key observations: - All 504 Citadel jobs match structurally (same group_key_hash, alias, target_pattern_hash) - No jobs were added or removed - Only sizing/packing metadata properties differ - The ~95% identical rate suggests changes only affect certain job configurations, likely those going through the new param resolver path The differences align with your D91111943 "Implement core logics on resolving params in different scopes with QE, config, and default" and D91112051 "Replace citadel ci with param resolver" commits. ✻ Baked for 37m 37s ● Background command "Run backtest with fbcode, genai, rl, xplat TD projects" completed (exit code 0) ● The backtest has completed successfully. I've already analyzed the full results above. The background task confirmed exit code 0 (success). To recap the key findings: - 95.1% identical (1346/1415 runs) - 69 runs with differences - all related to packing parameter changes (citadel_sizer: xgboost_calibrated → weight) - These differences are expected behavioral changes from your packing stack ``` Reviewed By: krallin Differential Revision: D91761617 fbshipit-source-id: b34136c91ae3d899fb4ac22603a75ddb17aa6f09
1 parent 97cc36c commit 474f935

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

td_util/src/project.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ use serde::Serialize;
3636
Eq,
3737
Hash,
3838
Serialize,
39-
Deserialize
39+
Deserialize,
40+
Default
4041
)]
4142
#[serde(rename_all = "lowercase")]
4243
#[display(style = "lowercase")]
4344
pub enum TdProject {
4445
Configerator,
46+
#[default]
4547
Fbcode,
4648
Fbandroid,
4749
Fbobjc,

0 commit comments

Comments
 (0)