Skip to content

Commit 42290f3

Browse files
edwardbrclaude
andcommitted
Add red border visualization for transports with negative ref counts
Transports that experience negative reference count errors now display a 3px red border in the telemetry visualization, making it easier to identify problematic transports at a glance. - Track transport errors in transportErrors Set - Apply red border styling to transport boxes with errors - Errors persist throughout visualization timeline Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 0bbb3e8 commit 42290f3

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

telemetry/src/animation_telemetry_service.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ svg {
436436
const PortRegistry = {}; // "zoneId:adjId" -> { relX, relY, absX, absY }
437437
const transportRefState = new Map(); // transportId -> { alive, createdAt, deletedAt, pairs: Map }
438438
const transportAuditState = { completed: false, lastEventTimestamp: 0 };
439+
const transportErrors = new Set(); // Set of transportIds with negative ref count errors
439440
const ADD_REF_OPTIMISTIC = 4;
440441
const RELEASE_OPTIMISTIC = 1;
441442
@@ -1612,17 +1613,21 @@ svg {
16121613
if (optimisticFlag) {
16131614
bucket.optimistic += delta;
16141615
if (bucket.optimistic < 0) {
1616+
const errorTransportId = makeTransportId(zoneNumber, adjacentNumber);
1617+
transportErrors.add(errorTransportId);
16151618
appendTransportAudit(
1616-
`transport ${makeTransportId(zoneNumber, adjacentNumber)} optimistic count went negative`,
1617-
{ transportId: makeTransportId(zoneNumber, adjacentNumber), destination: destinationNumber, caller: callerNumber });
1619+
`transport ${errorTransportId} optimistic count went negative`,
1620+
{ transportId: errorTransportId, destination: destinationNumber, caller: callerNumber });
16181621
bucket.optimistic = 0;
16191622
}
16201623
} else {
16211624
bucket.shared += delta;
16221625
if (bucket.shared < 0) {
1626+
const errorTransportId = makeTransportId(zoneNumber, adjacentNumber);
1627+
transportErrors.add(errorTransportId);
16231628
appendTransportAudit(
1624-
`transport ${makeTransportId(zoneNumber, adjacentNumber)} shared count went negative`,
1625-
{ transportId: makeTransportId(zoneNumber, adjacentNumber), destination: destinationNumber, caller: callerNumber });
1629+
`transport ${errorTransportId} shared count went negative`,
1630+
{ transportId: errorTransportId, destination: destinationNumber, caller: callerNumber });
16261631
bucket.shared = 0;
16271632
}
16281633
}
@@ -2764,13 +2769,19 @@ svg {
27642769
const boxHeight = p.boxHeight || transportMinHeight;
27652770
const lines = p.lines || [p.relY === 0 ? `IN:${adjId}` : `TO:${adjId}`];
27662771
2772+
// Check if this transport has errors
2773+
const transportId = makeTransportId(zId, adjId);
2774+
const hasError = transportErrors.has(transportId);
2775+
27672776
pG.append('rect')
27682777
.attr('class', 'transport-box')
27692778
.attr('x', -boxWidth / 2)
27702779
.attr('y', -boxHeight / 2)
27712780
.attr('width', boxWidth)
27722781
.attr('height', boxHeight)
2773-
.attr('rx', 4);
2782+
.attr('rx', 4)
2783+
.attr('stroke', hasError ? '#ff0000' : null)
2784+
.attr('stroke-width', hasError ? 3 : null);
27742785
27752786
const textStartX = -boxWidth / 2 + transportBoxPaddingX;
27762787
const textStartY = -boxHeight / 2 + transportBoxPaddingY + 9;

0 commit comments

Comments
 (0)