12 pages covering architecture, findings, and metrics from the rotatingMachine + machineGroupControl hardening work: - Overview: node inventory, what works/doesn't, current scale - Architecture: 3D pump curves, group optimization algorithm - Findings: BEP-Gravitation proof (0.1% of optimum), NCog behavior, curve non-convexity, pump switching stability - Metrics: test counts, power comparison table, performance numbers - Knowledge graph: structured YAML with all data points and provenance - Session log: 2026-04-07 production hardening - Tools: query.py, search.sh, lint.sh Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.2 KiB
title, created, updated, status, tags
| title | created | updated | status | tags | ||||
|---|---|---|---|---|---|---|---|---|
| Session: Production Hardening rotatingMachine + machineGroupControl | 2026-04-07 | 2026-04-07 | proven |
|
2026-04-07 — Production Hardening
Scope
Full code review and hardening of rotatingMachine and machineGroupControl nodes for production readiness.
Key Discoveries
-
Efficiency rounding destroyed NCog/BEP —
Math.round(Q/P * 100) / 100in canonical units (m3/s and W) produces ratios ~1e-6 that all round to 0. All NCog, cog, and BEP calculations were non-functional. Fixed by removing rounding. -
flowmovement unit mismatch — machineGroupControl computed flow in canonical (m3/s) and sent it directly to rotatingMachine which expected output units (m3/h). Every pump stayed at minimum flow. Fixed with
_canonicalToOutputFlow(). -
emergencyStop case mismatch —
"emergencyStop"vs config key"emergencystop". Emergency stop never worked. Fixed to lowercase. -
Curve data anomalies — 3 flow values leaked into power columns in hidrostal-H05K-S03R.json at pressures 1600, 3200, 3300 mbar. Fixed with interpolated values.
-
C5 pump non-convexity — 5 data points per pressure level produces non-convex spline. The marginal-cost refinement loop closes the gap to brute-force optimum from 2.1% to 0.1%.
Changes Made
rotatingMachine (3 files, 7 test files)
- Async input handler, null guards, listener cleanup, tick loop race fix
- showCoG() implementation, efficiency variant fix, curve anomaly detection
- 43 new tests (76 total)
machineGroupControl (1 file, 2 test files)
_canonicalToOutputFlow()on all flowmovement calls- Absolute scaling bug, empty Qd block, empty-machines guards
- Marginal-cost refinement loop in BEP-Gravitation
- Missing flowmovement after startup in equalFlowControl
generalFunctions (1 file)
- 3 curve data fixes in hidrostal-H05K-S03R.json
Verification
- 90 tests passing across both nodes
- machineGroupControl within 0.1% of brute-force global optimum (1000-step search)
- Pump switching stable: 1-2 transitions across full demand range, no hysteresis
- Optimization cost: 0.03-0.15ms per call (0.015% of tick budget)