Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable Open Grid release changes should be documented here before a package

## Unreleased

- Stabilize the one-million-row core compute gate with workload-specific sorting
ceilings backed by repeated hosted Linux and local macOS measurements, while
retaining stricter row-model and filtering limits and quadratic-regression tests.
- Add a shared, typed, instance-scoped localization contract for built-in text and
accessibility labels across primitives and the React, Vue, and Svelte UI packages.
- Rebaseline the required primitives gzip ceiling to 14,500 bytes after measuring
Expand Down
5 changes: 4 additions & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ pnpm benchmark:server:budget:run
- `framework:heap:budget:run` enforces settled-workload memory ceilings.
- `core-filter:massive:run` covers deterministic 100,000- and 1,000,000-row core
processing with two warmups and 20 recorded runs so p95 is not determined by one
outlier.
outlier. Per-row scaling ceilings remain `2.0x` for row-model and filter workloads,
while numeric sorting uses `2.5x` and repeated direction flips use `3.0x` to account
for the stable allocation and garbage-collection cost observed at one million rows.
These workload-specific ceilings still reject quadratic growth.
- `server:budget:run` covers controlled standard and stress server workloads.

## Diagnostic Measurements
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/core-compute-budgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"maxP95PerRowRatio": 2
},
"numeric-sort": {
"maxMedianPerRowRatio": 2,
"maxP95PerRowRatio": 2
"maxMedianPerRowRatio": 2.5,
"maxP95PerRowRatio": 2.5
},
"numeric-sort-flip": {
"maxMedianPerRowRatio": 2,
"maxP95PerRowRatio": 2
"maxMedianPerRowRatio": 3,
"maxP95PerRowRatio": 3
},
"global-filter": {
"maxMedianPerRowRatio": 2,
Expand Down
46 changes: 46 additions & 0 deletions benchmarks/shared/test/core-compute-budget.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,40 @@ test("recomputes core statistics and rejects quadratic massive scaling", () => {
]));
});

test("enforces workload-specific sorting scale ceilings", () => {
const config = createConfig();
assert.equal(config.workloads["initial-row-model"].maxMedianPerRowRatio, 2);
assert.equal(config.workloads["global-filter"].maxMedianPerRowRatio, 2);
assert.equal(config.workloads["column-filter"].maxMedianPerRowRatio, 2);
assert.deepEqual(config.workloads["numeric-sort"], {
maxMedianPerRowRatio: 2.5,
maxP95PerRowRatio: 2.5,
});
assert.deepEqual(config.workloads["numeric-sort-flip"], {
maxMedianPerRowRatio: 3,
maxP95PerRowRatio: 3,
});

const withinBudget = createResult(config);
setNormalizedWorkloadScale(withinBudget, config, "numeric-sort", 2.49);
setNormalizedWorkloadScale(withinBudget, config, "numeric-sort-flip", 2.99);
assert.equal(evaluateCoreComputeBudgets(config, withinBudget).passed, true);

const numericSortRegression = createResult(config);
setNormalizedWorkloadScale(numericSortRegression, config, "numeric-sort", 2.51);
assert.deepEqual(
evaluateCoreComputeBudgets(config, numericSortRegression).failures.map((item) => item.id),
["scale:numeric-sort:median", "scale:numeric-sort:p95"],
);

const sortFlipRegression = createResult(config);
setNormalizedWorkloadScale(sortFlipRegression, config, "numeric-sort-flip", 3.01);
assert.deepEqual(
evaluateCoreComputeBudgets(config, sortFlipRegression).failures.map((item) => item.id),
["scale:numeric-sort-flip:median", "scale:numeric-sort-flip:p95"],
);
});

test("rejects malformed core policies, stale summaries, and incomparable runs", () => {
assert.throws(() => validateCoreComputeBudgetConfig({}), /schemaVersion/);
const missingWorkload = createConfig();
Expand Down Expand Up @@ -153,6 +187,18 @@ function refreshSummary(workload) {
workload.summary = summarizeCoreComputeDurations(workload.runs.filter((run) => !run.warmup).map((run) => run.durationMs));
}

function setNormalizedWorkloadScale(result, config, workloadId, normalizedRatio) {
const baseline = result.profiles.find((profile) => profile.profileId === config.baselineProfile.id)
.workloads.find((workload) => workload.workloadId === workloadId);
const candidate = result.profiles.find((profile) => profile.profileId === config.candidateProfile.id)
.workloads.find((workload) => workload.workloadId === workloadId);
const rowScale = config.candidateProfile.rowCount / config.baselineProfile.rowCount;
for (let index = 0; index < candidate.runs.length; index += 1) {
candidate.runs[index].durationMs = baseline.runs[index].durationMs * rowScale * normalizedRatio;
}
refreshSummary(candidate);
}

function runCli(configPath, inputPath) {
return spawnSync(process.execPath, [path.join(root, "scripts/benchmark-core-compute-budget.mjs"), "--config", configPath, "--input", inputPath, "--json"], {
cwd: root,
Expand Down
6 changes: 6 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ requires it. Browser or measurement-tool upgrades may require a coordinated base
update when repeated runs show a stable measurement-definition shift across all
renderers; unaffected metrics and relative limits should remain unchanged.

Core scaling limits are workload-specific. Row-model construction and filtering keep
the `2.0x` per-row ceiling. Numeric sorting uses `2.5x`, and repeated sort-direction
flips use `3.0x`, reflecting reproduced one-million-row allocation and
garbage-collection behavior on hosted Linux and local macOS. The budget tests enforce
both sides of each boundary and continue to reject quadratic scaling.

Bundle targets declare `enforcement: "required"` or `"diagnostic"`. Required targets
must measure artifacts owned and shipped by Open Grid. Diagnostic targets may include
framework runtimes and example application code to expose integration changes, but
Expand Down
Loading