Skip to content
Merged
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
7 changes: 6 additions & 1 deletion e2e/master-refinement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ test.describe('MillOS master refinement runtime', () => {
name: 'Select MillOS version',
});
await expect(versionSelector).toHaveValue('v0.40');
await expect(versionSelector.locator('option')).toHaveText(['0.40', '0.30', '0.20', '0.10']);
await expect(versionSelector.locator('option')).toHaveText([
'0.40 (current)',
'0.30 (historical)',
'0.20 (historical)',
'0.10 (historical)',
]);
await expect(
overviewSidebar.getByRole('alert', { name: 'Mill Overview unavailable' })
).toHaveCount(0);
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/release-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
for (const release of matrix.releases) {
const option = document.createElement('option');
option.value = release.version;
option.textContent = release.label;
option.textContent = `${release.label} (${release.type === 'current' ? 'current' : 'historical'})`;
selector.append(option);
}
selector.value = matrix.releases.some((release) => release.version === activeVersion)
Expand Down
21 changes: 20 additions & 1 deletion scripts/run-performance-benchmark.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ function summarizeMotion(samples) {
distance: 0,
phases: [],
cargoStates: [],
stopReasons: [],
telemetry: {},
lastPosition: null,
};
Expand All @@ -344,6 +345,9 @@ function summarizeMotion(samples) {
if (entity.cargo && current.cargoStates.at(-1) !== entity.cargo) {
current.cargoStates.push(entity.cargo);
}
if (entity.stopReason && current.stopReasons.at(-1) !== entity.stopReason) {
current.stopReasons.push(entity.stopReason);
}
for (const key of numericTelemetryKeys) {
const value = entity[key];
if (!Number.isFinite(value)) continue;
Expand Down Expand Up @@ -401,6 +405,10 @@ function evaluateMotionAcceptance(samples, summary) {
.every((entity) => Math.abs(entity.articulation ?? 0) <= 0.701)
);
const movingEntities = summary.filter((entity) => entity.distance > 0.25);
const stationaryEntities = summary.filter((entity) => entity.distance <= 0.25);
const stationaryStatesExplained = stationaryEntities.every((entity) =>
entity.stopReasons.some((reason) => reason !== 'none')
);
const wheelTravelFollowsMotion = movingEntities.every(
(entity) => Math.abs(entity.telemetry.wheelTravel?.delta ?? 0) > 0.1
);
Expand All @@ -410,6 +418,14 @@ function evaluateMotionAcceptance(samples, summary) {
{ id: 'bounded-steering', passed: boundedSteering },
{ id: 'bounded-articulation', passed: boundedArticulation },
{ id: 'vehicle-motion-observed', passed: movingEntities.length > 0 },
{
id: 'stationary-vehicles-have-interlock-reason',
passed: stationaryStatesExplained,
observed: stationaryEntities.map((entity) => ({
id: entity.id,
stopReasons: entity.stopReasons,
})),
},
{ id: 'wheel-travel-follows-motion', passed: wheelTravelFollowsMotion },
];
return { passed: checks.every((check) => check.passed), checks };
Expand Down Expand Up @@ -789,7 +805,10 @@ async function main() {
systemComparisons: {
scada: scadaComparisons,
},
passed: results.every((result) => result.budget.passed && result.motionAcceptance.passed),
passed: results.every(
(result) =>
result.budget.passed && (options.startupOnly || result.motionAcceptance?.passed === true)
),
results,
};
const reportPath = path.join(options.output, 'benchmark.json');
Expand Down
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState, Suspense, useEffect, useCallback, useRef } from 'react';
import { Canvas } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { OrbitControls as OrbitControlsImpl } from 'three-stdlib';
import type { OrbitControls as OrbitControlsImpl } from 'three-stdlib';
import * as THREE from 'three';
import { trackRender } from './utils/renderProfiler';
import './utils/perfMonitor';
Expand Down Expand Up @@ -58,6 +57,7 @@ import { installAtmosphericFogChunks } from './shaders/atmosphericFog';
installAtmosphericFogChunks();

const PhysicsScene = recoverableLazy(() => import('./components/PhysicsScene'));
const DeferredOrbitControls = recoverableLazy(() => import('./components/SceneOrbitControls'));
const AuthoredMillScene = recoverableLazy(() =>
import('./components/MillScene').then((module) => ({ default: module.MillScene }))
);
Expand Down Expand Up @@ -844,7 +844,7 @@ const App: React.FC = () => {
<FirstPersonController onLockChange={handleLockChange} />
)
) : (
<OrbitControls
<DeferredOrbitControls
ref={orbitControlsRef}
maxPolarAngle={
runtimeMode.benchmark &&
Expand Down
16 changes: 16 additions & 0 deletions src/components/ConveyorSystem.kinematics.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { advanceBagPosition } from './ConveyorSystem';

describe('advanceBagPosition', () => {
it('moves at belt speed and caps a resumed-frame delta', () => {
expect(advanceBagPosition(0, 5, 1, 1)).toBeCloseTo(0.5);
});

it('preserves overflow when a bag wraps around the belt', () => {
expect(advanceBagPosition(27.9, 5, 1, 0.1)).toBeCloseTo(-27.6);
});

it('does not reverse while production is stopped', () => {
expect(advanceBagPosition(4, 5, -1, 0.1)).toBe(4);
});
});
Loading