feat(ci): metric-history gate — GATE_DEFAULTS one-liners + standard-metric sweep (M4)#1630
feat(ci): metric-history gate — GATE_DEFAULTS one-liners + standard-metric sweep (M4)#1630guapisolo wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a defaults mechanism (GATE_DEFAULTS) for standard metrics in CI gates, enabling concise one-liner declarations across various end-to-end tests. Omitted fields are automatically populated from these defaults during parsing. The feedback suggests copying the default values (such as lists or dicts) rather than assigning them by reference to prevent accidental mutation of the global GATE_DEFAULTS dictionary.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if field not in raw: | ||
| raw[field] = defaults[field] |
There was a problem hiding this comment.
To prevent accidental mutation of the global GATE_DEFAULTS dictionary (or any nested mutable structures like constraint dicts or step lists) by downstream consumers, it is safer to copy the default values rather than assigning them by reference.
| if field not in raw: | |
| raw[field] = defaults[field] | |
| if field not in raw: | |
| val = defaults[field] | |
| raw[field] = val.copy() if isinstance(val, (dict, list)) else val |
a153a8c to
b83d248
Compare
c4d12d3 to
1f99ee2
Compare
1f99ee2 to
54d8548
Compare
a82faff to
3afe435
Compare
54d8548 to
b456c85
Compare
3afe435 to
04053e0
Compare
Provide schema-validated defaults for the five standard metrics and use one-line declarations in eligible Megatron CUDA training tests on the current upstream layout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
b456c85 to
7696acf
Compare
04053e0 to
0582594
Compare
Summary
One-line
register_ci_gatedeclarations for standard metrics, swept across the CUDA RL e2e tests.Motivation
Requiring every test to write
steps+constraintliterals makes blanket coverage expensive: the standard metrics (train/grad_norm,train/ppo_kl, logp-diff,rollout/raw_reward) want the same defaults everywhere. A per-metric_keydefaults table beside the parser supplies them, so the one-liner is a complete minimal declaration. The sweep lands in the same PR so the table ships together with its consumers.Usage
Design Notes
GATE_DEFAULTSentry must still write both fields.return_logprobunconditionally, every target runspolicy_loss, so all five keys exist in every target's record.test_mimo_7B_mtp_only_grad(zero grads by design),test_qwen3_4B_ckpt(multi-stage record merge needs its own look).Verification
test_one_liner_fills_from_gate_defaults,test_partial_default_written_literal_wins,test_one_liner_without_table_entry_rejected,test_gate_defaults_within_capture_whitelist_and_valid,test_one_liner_runtime_is_noop.register_cuda_ciregistry intact.tests/ci/test/run passes (247 passed, 1 skipped).Review Focus
GATE_DEFAULTSband values inregister.py— shadow-calibration starting points; test owners tune or veto their line in the sweep commit._parse_ci_gate_call— it runs before the required-field check, feeding_canonical_keythe table literal, never the normalized form.