fix(cli): keep the DE parallel-router trial on until a real failure, not first engagement

Only consuming telemetry from one data point per install badly undersampled
the "routed" (successful) outcome — the far more common case. Changed
maybeConsumeDeParallelRouterTrial to only turn the trial off when the
router's OWN safety net actually fired (deParallelRouter === "reverted"),
not on a clean "routed" success. This runs the experiment on every eligible
render for an install indefinitely until it hits one real failure, then
stops for that install going forward — trading a slightly higher per-install
ceiling on experimental-path exposure for dramatically more successful-
routing telemetry volume across the fleet.

Also fixed a related edge case while updating this: a render that merely
"routed" (router fired, self-verify never even tripped) but then crashed
for an unrelated reason (e.g. cancellation) no longer counts as a router
failure — only "reverted" (the router's fallback path actually engaged)
does. Cancelling a render isn't evidence the router is unsafe.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-07-09 21:49:21 -07:00
co-authored by Claude Sonnet 5
parent 37b6a4e7e5
commit 19f90b0b92
3 changed files with 67 additions and 29 deletions
+27 -3
View File
@@ -505,7 +505,7 @@ describe("renderLocal — DE parallel-router CLI trial", () => {
expect(process.env.HF_DE_PARALLEL_ROUTER).toBeUndefined();
});
it("persists deParallelRouterTrialFired when the router actually engages on a successful render", async () => {
it("does NOT persist the trial as fired on a clean 'routed' success — keeps trying on future renders", async () => {
configState.config = { telemetryEnabled: true, deParallelRouterTrialFired: false };
producerState.executeImpl = async (job) => {
job.perfSummary = {
@@ -514,6 +514,18 @@ describe("renderLocal — DE parallel-router CLI trial", () => {
};
};
await renderLocal("/tmp/project", "/tmp/out.mp4", baseOptions);
expect(configState.writeConfigCalls).toHaveLength(0);
});
it("persists the trial as fired when the router's own safety net actually reverted", async () => {
configState.config = { telemetryEnabled: true, deParallelRouterTrialFired: false };
producerState.executeImpl = async (job) => {
job.perfSummary = {
resolution: { width: 100, height: 100 },
drawElement: { parallelRouter: "reverted" },
};
};
await renderLocal("/tmp/project", "/tmp/out.mp4", baseOptions);
expect(configState.writeConfigCalls).toContainEqual(
expect.objectContaining({ deParallelRouterTrialFired: true }),
);
@@ -528,11 +540,23 @@ describe("renderLocal — DE parallel-router CLI trial", () => {
expect(configState.writeConfigCalls).toHaveLength(0);
});
it("persists the trial as fired from the failure path when the router engaged before a hard crash", async () => {
it("does NOT persist the trial as fired when a render merely 'routed' crashes for an unrelated reason (e.g. cancellation) — not a router failure", async () => {
configState.config = { telemetryEnabled: true, deParallelRouterTrialFired: false };
producerState.executeImpl = async (job) => {
job.errorDetails = { observability: { capture: { deParallelRouter: "routed" } } };
throw new Error("worker crashed");
throw new Error("render cancelled");
};
await renderLocal("/tmp/project", "/tmp/out.mp4", { ...baseOptions, throwOnError: true }).catch(
() => {},
);
expect(configState.writeConfigCalls).toHaveLength(0);
});
it("persists the trial as fired from the failure path when the router's safety net reverted but the retry still failed", async () => {
configState.config = { telemetryEnabled: true, deParallelRouterTrialFired: false };
producerState.executeImpl = async (job) => {
job.errorDetails = { observability: { capture: { deParallelRouter: "reverted" } } };
throw new Error("worker crashed even after fallback");
};
await renderLocal("/tmp/project", "/tmp/out.mp4", { ...baseOptions, throwOnError: true }).catch(
() => {},