diff --git a/openpilot/starpilot/galaxy/tests/test_flm_tracking_results.mjs b/openpilot/starpilot/galaxy/tests/test_flm_tracking_results.mjs index 013ca9498f..7c8a902643 100644 --- a/openpilot/starpilot/galaxy/tests/test_flm_tracking_results.mjs +++ b/openpilot/starpilot/galaxy/tests/test_flm_tracking_results.mjs @@ -246,6 +246,16 @@ const measuredWindow={version:1,domain:'lateral_acceleration',samples:2000,windo sampling:'input_ordered_original_endpoints_no_interpolation'} ctx.report.current.details['Recorded steering response']=measuredWindow ctx.report.current.details['Saved route adjustment count']=0 +assert(validTrainingResults(ctx.report),'The whole wire report must accept its bounded recorded graph before rendering') +const completeGraph=structuredClone(ctx.report) +completeGraph.current.details['Recorded steering response']={...measuredWindow,source_end_ns:7.3e9, + points:Array.from({length:64},(_,i)=>[1e9+i*1e8,.2,.08])} +assert(validTrainingResults(completeGraph),'The production 64-point recorded graph fits the wire contract') +completeGraph.current.details['Recorded steering response'].points.push([7.4e9,.2,.08]) +assert(!validTrainingResults(completeGraph),'The recorded graph retains its 64-point bound') +const unboundedDetails=structuredClone(ctx.report) +unboundedDetails.current.details['Unknown nested diagnostic']={points:measuredWindow.points} +assert(!validTrainingResults(unboundedDetails),'Unrelated nested details retain their original bounds') ctx.report.current.details['Controller and encoder check windows']=[22,24] ctx.report.current.details['Automatic tune refusal reasons']=[['original_scored_frame_not_eligible',1],['candidate changed an actual limiter/support',1]] assert.equal(ctx.offroad.observed.errorRms,.12) @@ -268,6 +278,7 @@ for(const changed of [{points:measuredWindow.points.toReversed()},{error_rms:NaN {source_end_ns:measuredWindow.source_end_ns+1}]){ ctx.report.current.details['Recorded steering response']={...measuredWindow,...changed} assert.equal(ctx.offroad.observed,null,'Malformed recorded data cannot populate the graph') + assert(!validTrainingResults(ctx.report),'Malformed recorded graphs must be refused at the wire boundary') } ctx.report.current.details['Recorded steering response']={...measuredWindow,domain:'steering_angle'} assert.equal(ctx.offroad.observed.units,'degrees','PID observations retain their angle units') diff --git a/openpilot/starpilot/galaxy/web/js/flm-training-results.js b/openpilot/starpilot/galaxy/web/js/flm-training-results.js index b3b5f8b748..e4b514d3f1 100644 --- a/openpilot/starpilot/galaxy/web/js/flm-training-results.js +++ b/openpilot/starpilot/galaxy/web/js/flm-training-results.js @@ -52,7 +52,8 @@ export function validTrainingResults(value) { (["Full surface coordinates", "Actual full surface coordinates"].includes(key) ? fullCoordinates(item) !== null : key === 'Applied correction coordinates' && Array.isArray(item) && item.length === 30 ? item.every(number => typeof number === 'number' && Number.isFinite(number) && Math.abs(number) <= .25) : - key === 'GLOBAL source observation refusals' ? validSourceRefusals(item) : detailValue(item))) + key === 'GLOBAL source observation refusals' ? validSourceRefusals(item) : + key === 'Recorded steering response' ? item === null || recordedSteeringView(item) !== null : detailValue(item))) } const labels = { collecting: "Gathering driving examples", unavailable: "Waiting for usable driving data", qualifiedFit: "Fit passed validation", qualified: "Fit passed validation", rejected: "Fit did not pass validation", diff --git a/prebuilt.json b/prebuilt.json index 7fbcfc83ae..2ee22e9537 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "2cf0604813fb378a0b92ed78c384f71b57be90c37c0c80dda6a500dcb35c9bbf", "schema_version": 1} +{"protected_inventory_sha256": "24ae38f7cce813f880bd39e2f8c643e9469888b3a86a4e8aa0067b01739b83df", "schema_version": 1}