refactor(planning): remove the original decision trace
CI / policy (push) Successful in 7s
CI / validate (push) Successful in 1m15s
CI / test (push) Successful in 3m18s
CI / benchmark (push) Failing after 5m53s
CI / build (push) Successful in 1m23s
CI / security (push) Successful in 7m6s
CI / policy (pull_request) Successful in 7s
CI / validate (pull_request) Successful in 1m9s
CI / build (pull_request) Successful in 43s
CI / test (pull_request) Successful in 3m19s
CI / images (push) Successful in 3m7s
CI / required (push) Successful in 2s
CI / benchmark (pull_request) Failing after 5m28s
CI / security (pull_request) Successful in 6m37s
CI / images (pull_request) Successful in 3m18s
CI / required (pull_request) Successful in 1s
CI / policy (push) Successful in 7s
CI / validate (push) Successful in 1m15s
CI / test (push) Successful in 3m18s
CI / benchmark (push) Failing after 5m53s
CI / build (push) Successful in 1m23s
CI / security (push) Successful in 7m6s
CI / policy (pull_request) Successful in 7s
CI / validate (pull_request) Successful in 1m9s
CI / build (pull_request) Successful in 43s
CI / test (pull_request) Successful in 3m19s
CI / images (push) Successful in 3m7s
CI / required (push) Successful in 2s
CI / benchmark (pull_request) Failing after 5m28s
CI / security (pull_request) Successful in 6m37s
CI / images (pull_request) Successful in 3m18s
CI / required (pull_request) Successful in 1s
This commit is contained in:
1 parent
ea4256107f
commit
d9d9befa12
43 files changed
+729
-8880
No files matched your search
@@ -2,7 +2,6 @@ import {
|
||||
createPlanningCalculation,
|
||||
PlanningOutcome,
|
||||
PlanningRequest,
|
||||
PlanningTrace,
|
||||
} from '../services/leave-planner.service';
|
||||
import { createOptimizationPresetRules } from '../services/rule-service';
|
||||
|
||||
@@ -16,21 +15,15 @@ export interface BenchmarkMeasurement {
|
||||
repetition: number;
|
||||
preparationMs: number;
|
||||
planningMs: number;
|
||||
traceDeliveryMs: number;
|
||||
maxUiDelayMs: number;
|
||||
/** Chromium's main-thread heap only; worker memory needs a separate browser profile. */
|
||||
peakMainThreadHeapBytes?: number;
|
||||
planningWorkMs?: number;
|
||||
traceCaptureMs?: number;
|
||||
traceMaterializationMs?: number;
|
||||
traceTransferMs?: number;
|
||||
wallMs: number;
|
||||
outcome: PlanningOutcome['kind'];
|
||||
lastCompletedStage?: string;
|
||||
placements: number;
|
||||
deterministic: 'baseline' | 'yes' | 'no';
|
||||
traceStatus: PlanningTrace['status'] | 'not-produced';
|
||||
traceCandidates: number;
|
||||
}
|
||||
|
||||
const balance = (
|
||||
@@ -219,7 +212,8 @@ export async function runLeavePlannerBenchmark(repetitions = 1): Promise<Benchma
|
||||
async function warmUpScenario(scenario: BenchmarkScenario): Promise<void> {
|
||||
const calculation = createPlanningCalculation(structuredClone(scenario.request));
|
||||
await calculation.outcome;
|
||||
await calculation.trace;
|
||||
await calculation.explanation;
|
||||
await calculation.timings;
|
||||
}
|
||||
|
||||
async function measureRepetition(
|
||||
@@ -250,24 +244,11 @@ async function measureRepetition(
|
||||
const calculation = createPlanningCalculation(request);
|
||||
const outcome = await calculation.outcome;
|
||||
const planningMs = performance.now() - calculationStart;
|
||||
const traceStart = performance.now();
|
||||
const trace = await calculation.trace;
|
||||
const traceDeliveryMs = performance.now() - traceStart;
|
||||
const timings = await calculation.timings;
|
||||
const summary = resultSummary(outcome);
|
||||
const stable = JSON.stringify(outcome);
|
||||
const deterministic =
|
||||
baseline === undefined ? 'baseline' : stable === baseline ? 'yes' : 'no';
|
||||
const traceCandidates =
|
||||
trace?.phases.reduce(
|
||||
(total, phase) =>
|
||||
total +
|
||||
phase.decisions.reduce(
|
||||
(decisionTotal, decision) => decisionTotal + decision.candidates.length,
|
||||
0,
|
||||
),
|
||||
0,
|
||||
) ?? 0;
|
||||
const wallMs = performance.now() - wallStart;
|
||||
measureDelay();
|
||||
return {
|
||||
@@ -276,15 +257,12 @@ async function measureRepetition(
|
||||
repetition,
|
||||
preparationMs,
|
||||
planningMs,
|
||||
traceDeliveryMs,
|
||||
maxUiDelayMs,
|
||||
peakMainThreadHeapBytes,
|
||||
...timings,
|
||||
wallMs,
|
||||
...summary,
|
||||
deterministic,
|
||||
traceStatus: trace?.status ?? 'not-produced',
|
||||
traceCandidates,
|
||||
},
|
||||
stable,
|
||||
};
|
||||
@@ -295,7 +273,7 @@ async function measureRepetition(
|
||||
|
||||
export function benchmarkReport(measurements: BenchmarkMeasurement[]): string {
|
||||
const header =
|
||||
'scenario\trepetition\tpreparation_ms\tplanning_ms\ttrace_delivery_ms\twall_ms\toutcome\tlast_stage\tplacements\tdeterministic\ttrace_status\ttrace_candidates\tmax_ui_delay_ms\tplanning_work_ms\ttrace_capture_ms\ttrace_materialization_ms\ttrace_transfer_ms\tpeak_main_thread_heap_bytes';
|
||||
'scenario\trepetition\tpreparation_ms\tplanning_ms\twall_ms\toutcome\tlast_stage\tplacements\tdeterministic\tmax_ui_delay_ms\tplanning_work_ms\tpeak_main_thread_heap_bytes';
|
||||
return [
|
||||
header,
|
||||
...measurements.map((item) =>
|
||||
@@ -304,19 +282,13 @@ export function benchmarkReport(measurements: BenchmarkMeasurement[]): string {
|
||||
item.repetition,
|
||||
item.preparationMs.toFixed(1),
|
||||
item.planningMs.toFixed(1),
|
||||
item.traceDeliveryMs.toFixed(1),
|
||||
item.wallMs.toFixed(1),
|
||||
item.outcome,
|
||||
item.lastCompletedStage ?? '',
|
||||
item.placements,
|
||||
item.deterministic,
|
||||
item.traceStatus,
|
||||
item.traceCandidates,
|
||||
item.maxUiDelayMs.toFixed(1),
|
||||
item.planningWorkMs?.toFixed(1) ?? '',
|
||||
item.traceCaptureMs?.toFixed(1) ?? '',
|
||||
item.traceMaterializationMs?.toFixed(1) ?? '',
|
||||
item.traceTransferMs?.toFixed(1) ?? '',
|
||||
item.peakMainThreadHeapBytes ?? '',
|
||||
].join('\t'),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user