fix(kernel): follow KernelForge's CLI where it moved - #1228
Open
ZhengGong-amd wants to merge 3 commits into
Open
fix(kernel): follow KernelForge's CLI where it moved#1228ZhengGong-amd wants to merge 3 commits into
ZhengGong-amd wants to merge 3 commits into
Conversation
Two options this repository sends to KernelForge no longer exist there. `forge-fuse` renamed `--llm-model` to `--model`, and unlike `forge-loop` it is not a tolerant command: an unknown option is a click UsageError, so the child exited 2 before authoring anything and the wrapper reported the outcome as a missing `fusion_manifest.json` — an infrastructure-shaped error for what was really a stale flag. Only the argv string moves; the `llm_model` key in the wrapper's own input JSON is what the orchestrator writes and stays as it is. `--gpu-arch` was renamed alongside it, but this repository never passed it. `--max-iters` was deleted from `forge-loop` and `forge-rewrite-by-flydsl`. Those two are tolerant, so sending it was never fatal — it was reported as an ignored option and dropped. It is gone from all three argv builders here, along with the parameters that carried it and the `FORGE_MAX_ITERS` / `FORGE_COMPILED_MAX_ITERS` environment variables behind them. The compiled/ASM fellow cap those fed could not have worked: KernelForge stopped acting on the value when the supervisor's intervention limit was removed, so the block logged a cap it never applied. Campaign length is `--max-hours` and the hard kill, which is what it already was. `forge_collective` had already stopped sending the flag for the same reason. The argv tests now assert the absence of both flags rather than their values, so neither can return unnoticed. Not changed, having been checked: the fusion manifest reader keys off `fusion_loop.kept`, which is exactly the field KernelForge tightened to require a commit, so it inherits the stricter verdict with no edit; nothing here imports from `kernel_agents` or `forge_llm`, so the workspace guard moving out of the Codex backend and the deletion of `CodexSafetyError` reach nothing; and every other option in all five argv builders is still declared upstream. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
_validated_forge_best_result gated on schema_version == 1. KernelForge has stamped 2 into best_result.json since 2026-08-13, so the gate rejected every published best and the kernel backend fell through to the caller checkpoint or the stdout sentinel — losing the one record that survives a hard kill, which is the case that file exists for. The gate now names the producer's constant instead of a bare literal, and a test pins the two together so the next bump cannot drift unnoticed. The checkpoint gate beside it stays at 1: the checkpoint really does carry that version. Eight tests already covered this salvage path in full; they were passing only because their own fixtures repeated the wrong version. They now publish what the producer publishes, which is why fixing the gate needed no other change: the behaviour was specified and tested all along, just never reachable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CI E2E report — ❌ Failed
|
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
KernelForge removed one CLI option and renamed another. This makes the places
that address its CLI match what it now declares, and — found while auditing
that surface — repairs a third producer/consumer disagreement that had been
silently discarding the published best result.
forge-fuse:--llm-modelis now--model(forge_fusion.py:136).This one is fatal today.
forge-fuseis a plain click command, not one of thetolerant ones, so an option it no longer declares raises
UsageErrorand thechild exits 2 having authored nothing. The wrapper then finds no manifest and
reports
no fusion_manifest.json at ... (forge-fusion rc=2)— aninfrastructure-shaped error for what is really a stale flag. Only the argv
string moves;
llm_modelstays as the key of the wrapper's own input JSON,which is what
request_handlers._run_forge_fusionwrites. KernelForge renamed--gpu-archto--gpu-targetin the same commit, but this repository neverpassed it.
forge-loop/forge-rewrite-by-flydsl:--max-itersis gone. Both areTolerantCommands, so sending it was never fatal — it was warned about, listedin
ignored_cli_options, and dropped. It is now gone from all three argvbuilders in
forge_submit.py, together with the parameters that carried it andthe
FORGE_MAX_ITERS/FORGE_COMPILED_MAX_ITERSenvironment variables behindthem.
That last part deserves a sentence of its own: the compiled/ASM fellow cap
those variables fed could not have been working. KernelForge stopped acting
on
--max-iterswhen the supervisor's intervention limit was removed, and itsown help had said "accepted but does not limit iterations or interventions"
ever since. So
log.info("forge: capping compiled/ASM fellow %s iters %d -> %d")announced a policy nothing enforced. Removing it changes no runtime behaviour;
it removes a false log line and two knobs that did nothing. Campaign length is
--max-hoursplus the hard-kill timeout, which is what it already was. If theintent — a smaller budget for structurally low-yield fellows — is still wanted,
the honest form is a reduced
--max-hoursfor non-triton fellows, and that is apolicy change worth its own PR rather than a silent revival here.
forge_collectivehad already stopped sending the flag, calling it "adocumented no-op"; this follows that precedent.
Checked and deliberately not changed:
fusion_loop.kept(
forge_fusion.py:255), which is precisely the field KernelForge tightened torequire the loop's
best_commitbefore it reports a keep. It inherits thestricter verdict with no edit, and never infers a keep from a non-null
speedup. Manifest keys, values and
schema_versionare unchanged upstream.kernel_agentsorforge_llmat the Python level (onlyinstall.sh's import probe, whose targets still exist), so KernelForgelifting the workspace guard out of its Codex backend and deleting
CodexSafetyErrorreaches nothing in this repository. Thecodex_session.pydocstring that mentions the guard says only why
CodexBackendcannot bereused, which is still true.
_run_loop_via_cli,_run_rewrite_via_cli,_run_vendor_playbook_loop_via_cli,forge_collective._build_cmd,forge_fusion._build_cmd— was cross-checkedagainst KernelForge's current
cli.pyandfusion/command.py. All stilldeclared, with unchanged types and defaults.
best_result.jsonwas being thrown away, and now is not.forge_submit.py:2298gated the published best onschema_version != 1, butKernelForge has stamped
2there since 2026-08-13(
MANIFEST_SCHEMA_VERSION,loop/reporting.py:24) — before this series, sothis is a pre-existing drift rather than fallout from it.
_validated_forge_best_resulttherefore rejected every published best and thekernel backend fell through to the caller checkpoint or the stdout sentinel,
losing the one record that survives a hard kill, which is the case that file
exists for.
The gate now names the producer's constant rather than a bare literal, and a
test pins the two together (
pytest.importorskiponkernel_agents.loop.reporting, so it runs wherever KernelForge is resolvablefrom
$FORGE_PATHand skips elsewhere) so the next bump cannot driftunnoticed. The checkpoint gate beside it stays at
1— the checkpoint reallydoes carry that version.
What makes this low-risk rather than a leap: eight tests already covered this
salvage path end to end — timeout salvage, recovery-channel disagreement,
in-place restore failure, same-iteration conflict — and they were passing only
because their own fixtures repeated the wrong version. Pointing the fixtures at
what the producer publishes was the only other change needed. The behaviour was
specified and tested all along; it was simply unreachable in production.
Linked issue(s): none. Pairs with the KernelForge branch
refactor/zgong/shared-substrate, whose CHANGELOG[Unreleased]records theremoved option and the two renamed ones.
Tests: added/updated? commands run?
Updated. The argv tests now assert the absence of both flags rather than
their values, so neither can come back unnoticed:
test_forge_long_horizon_cli.pyadds--max-itersto the existing"options forge-loop does not declare" loop and asserts it out of the rewrite
argv;
test_forge_fusion.pyasserts--modelis present and--llm-modelisnot. The
max_iters=keyword arguments in four test modules went with theparameters they fed.
One test added: the schema pin described above. Four fixture files now carry
the
schema_versionthe producer writes.FORGE_MAX_ITERSandFORGE_COMPILED_MAX_ITERSno longer exist. Anythingsetting them was setting a value that reached a flag KernelForge discarded, so
no run changes shape; the variables just stop being read. Recorded under
### Removedin the changelog.🤖 Generated with Claude Code