Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edges and Overlays Optimizations #141

Merged
merged 24 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
31cfc7f
graph startup collapsed, group overlay bug, collapsed NestedSDFG lod …
LeandroTreu Apr 3, 2024
85627ce
added missing comment
LeandroTreu Apr 3, 2024
378630e
added code to layouter to order the connectors (much less edges inter…
LeandroTreu Apr 7, 2024
e6b9576
first code for summarised edges, adjusted nodesep & ranksep
LeandroTreu Apr 8, 2024
0cb61c5
removed edge summary for tasklets, added summary symbol
LeandroTreu Apr 9, 2024
683f451
changed edge summary symbol, hovering nodes and connectors shows summ…
LeandroTreu Apr 9, 2024
cfadf03
fixed error when selecting memlet
LeandroTreu Apr 10, 2024
8dc77e3
fixed fill_info to show memlet src/dst connectors
LeandroTreu Apr 12, 2024
58559d8
fixed summary symbol toggled on when not applicable
LeandroTreu Apr 12, 2024
3714868
added shift+rightclick to expand, ctrl+scroll to verticalscroll
LeandroTreu Apr 12, 2024
257926e
memory overlays LOD threshold fixes
LeandroTreu Apr 15, 2024
ad5e64c
overlays state LOD changes
LeandroTreu Apr 15, 2024
87268ae
renderer loop region bugfix and overlay comment
LeandroTreu Apr 15, 2024
d85c305
fixed LogicalGroupOverlay on by default but UI not updated, optimized…
LeandroTreu Apr 16, 2024
ce08155
AvgParallelismOverlay reworked lod code based on new renderer
LeandroTreu Apr 16, 2024
ebcd7e6
STATE_LOD comment, changed all LOD threshold checks to strict inequal…
LeandroTreu Apr 16, 2024
52863dc
DepthOverlay lod rework
LeandroTreu Apr 16, 2024
d1ae766
OpIntOverlay lod rework
LeandroTreu Apr 17, 2024
8bebdc8
Overlays State lod rework, removed debug
LeandroTreu Apr 17, 2024
d35ad78
changed spelling to summarize
LeandroTreu Apr 24, 2024
0aaa125
merge with master
LeandroTreu Apr 24, 2024
bbbaf67
moved Dagre layout options to sdfv.ts
LeandroTreu May 2, 2024
87488ce
Merge branch 'master' of github.com:spcl/dace-webclient into ltreu-sa…
LeandroTreu May 3, 2024
2e5b958
removed commented out section, formatting adjusted
LeandroTreu May 3, 2024
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
22 changes: 11 additions & 11 deletions src/overlays/avg_parallelism_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ export class AvgParallelismOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
block.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(block.width * block.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
block.attributes()?.is_collapsed) {
this.shadeNode(block, ctx);
} else if (block instanceof State) {
Expand All @@ -245,20 +245,20 @@ export class AvgParallelismOverlay extends GenericSdfgOverlay {
visibleRect.y, visibleRect.w, visibleRect.h))
return;

if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
this.shadeNode(node, ctx);
} else {
if (node instanceof NestedSDFG &&
node.attributes().sdfg &&
node.attributes().sdfg.type !== 'SDFGShell') {
if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) {
const nodeppp = Math.sqrt(node.width * node.height) / ppp;
if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) {
this.shadeNode(node, ctx);
}
else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') {
this.recursivelyShadeCFG(
node.data.graph, ctx, ppp, visibleRect
);
} else {
this.shadeNode(node, ctx);
}
}
else {
this.shadeNode(node, ctx);
}
});
}
} else if (block instanceof ControlFlowRegion) {
Expand Down
22 changes: 11 additions & 11 deletions src/overlays/depth_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ export class DepthOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
state.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(state.width * state.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
state.data.state.attributes.is_collapsed) {
this.shade_node(state, ctx);
} else {
Expand All @@ -230,20 +230,20 @@ export class DepthOverlay extends GenericSdfgOverlay {
visible_rect.y, visible_rect.w, visible_rect.h))
return;

if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
this.shade_node(node, ctx);
} else {
if (node instanceof NestedSDFG &&
node.attributes().sdfg &&
node.attributes().sdfg.type !== 'SDFGShell') {
if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) {
const nodeppp = Math.sqrt(node.width * node.height) / ppp;
if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) {
this.shade_node(node, ctx);
}
else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') {
this.recursively_shade_sdfg(
node.data.graph, ctx, ppp, visible_rect
);
} else {
this.shade_node(node, ctx);
}
}
else {
this.shade_node(node, ctx);
}
});
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/overlays/logical_group_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ export class LogicalGroupOverlay extends GenericSdfgOverlay {
// In that case, we overlay the correct grouping color(s).
// If it's expanded or zoomed in close enough, we traverse inside.
const sdfgGroups = sdfg.attributes.logical_groups;
if (sdfgGroups === undefined)
if (sdfgGroups === undefined || sdfgGroups.length === 0) {
return;
}

if (!graph) {
return;
}

graph?.nodes().forEach(v => {
const block = graph.node(v);
Expand All @@ -101,8 +106,8 @@ export class LogicalGroupOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
block.width / ppp <= SDFV.STATE_LOD)) ||
const blockppp = Math.sqrt(block.width * block.height) / ppp;
if (((ctx as any).lod && (blockppp < SDFV.STATE_LOD)) ||
block.attributes().is_collapsed
) {
this.shadeNode(block, sdfgGroups, ctx);
Expand All @@ -121,7 +126,7 @@ export class LogicalGroupOverlay extends GenericSdfgOverlay {
return;

if (node.attributes().is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
((ctx as any).lod && ppp > SDFV.NODE_LOD)) {
this.shadeNode(node, sdfgGroups, ctx);
} else {
if (node instanceof NestedSDFG &&
Expand Down
10 changes: 6 additions & 4 deletions src/overlays/memory_location_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ export class MemoryLocationOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
block.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(block.width * block.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
block.attributes()?.is_collapsed) {
// The block is collapsed or invisible, so we don't need to
// The state is collapsed or too small, so we don't need to
// traverse its insides.
return;
} else if (block instanceof State) {
Expand All @@ -267,7 +267,9 @@ export class MemoryLocationOverlay extends GenericSdfgOverlay {
node.data.graph, ctx, ppp, visibleRect
);
} else if (node instanceof AccessNode) {
this.shadeNode(node, ctx);
if (!(ctx as any).lod || ppp < SDFV.NODE_LOD) {
this.shadeNode(node, ctx);
}
}
});
}
Expand Down
23 changes: 13 additions & 10 deletions src/overlays/memory_volume_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,19 @@ export class MemoryVolumeOverlay extends GenericSdfgOverlay {
graph.nodes().forEach(v => {
const block: ControlFlowBlock = graph.node(v);

// If we're zoomed out enough that the contents aren't visible, we
// skip the state.
if ((ctx as any).lod && (
ppp >= SDFV.STATE_LOD || block.width / ppp < SDFV.STATE_LOD
))
return;

// If the node's invisible, we skip it.
if ((ctx as any).lod && !block.intersect(
visibleRect.x, visibleRect.y,
visibleRect.w, visibleRect.h
) || block.attributes()?.is_collapsed)
return;

// If we're zoomed out enough that the contents aren't visible, we
// skip the state.
const stateppp = Math.sqrt(block.width * block.height) / ppp;
if ((ctx as any).lod && (stateppp < SDFV.STATE_LOD))
return;

if (block instanceof State) {
const state_graph = block.data.graph;
if (state_graph) {
Expand All @@ -203,7 +202,7 @@ export class MemoryVolumeOverlay extends GenericSdfgOverlay {
// If we're zoomed out enough that the node's contents
// aren't visible or the node is collapsed, we skip it.
if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD))
((ctx as any).lod && ppp > SDFV.NODE_LOD))
return;

if (node instanceof NestedSDFG &&
Expand All @@ -218,8 +217,12 @@ export class MemoryVolumeOverlay extends GenericSdfgOverlay {
state_graph.edges().forEach((e: any) => {
const edge: Edge = state_graph.edge(e);

if ((ctx as any).lod && !edge.intersect(visibleRect.x,
visibleRect.y, visibleRect.w, visibleRect.h))
// Skip if edge is invisible, or zoomed out far
if ((ctx as any).lod
&& (!edge.intersect(visibleRect.x, visibleRect.y, visibleRect.w, visibleRect.h)
|| ppp > SDFV.EDGE_LOD
)
)
return;

this.shadeEdge(edge, ctx);
Expand Down
22 changes: 11 additions & 11 deletions src/overlays/operational_intensity_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ export class OperationalIntensityOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
state.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(state.width * state.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
state.data.state.attributes.is_collapsed) {
this.shade_node(state, ctx);
} else {
Expand All @@ -273,20 +273,20 @@ export class OperationalIntensityOverlay extends GenericSdfgOverlay {
visible_rect.y, visible_rect.w, visible_rect.h))
return;

if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
this.shade_node(node, ctx);
} else {
if (node instanceof NestedSDFG &&
node.attributes().sdfg &&
node.attributes().sdfg.type !== 'SDFGShell') {
if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) {
const nodeppp = Math.sqrt(node.width * node.height) / ppp;
if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) {
this.shade_node(node, ctx);
}
else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') {
this.recursively_shade_sdfg(
node.data.graph, ctx, ppp, visible_rect
);
} else {
this.shade_node(node, ctx);
}
}
else {
this.shade_node(node, ctx);
}
});
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/overlays/runtime_micro_seconds_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export class RuntimeMicroSecondsOverlay extends RuntimeReportOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
state.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(state.width * state.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
state.data.state.attributes.is_collapsed) {
this.shade_node(state, ctx);
} else {
Expand All @@ -146,20 +146,20 @@ export class RuntimeMicroSecondsOverlay extends RuntimeReportOverlay {
visible_rect.y, visible_rect.w, visible_rect.h))
return;

if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
this.shade_node(node, ctx);
} else {
if (node instanceof NestedSDFG &&
node.attributes().sdfg &&
node.attributes().sdfg.type !== 'SDFGShell') {
if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) {
const nodeppp = Math.sqrt(node.width * node.height) / ppp;
if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) {
this.shade_node(node, ctx);
}
else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') {
this.recursively_shade_sdfg(
node.data.graph, ctx, ppp, visible_rect
);
} else {
this.shade_node(node, ctx);
}
}
else {
this.shade_node(node, ctx);
}
});
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/overlays/simulated_operational_intensity_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ export class SimulatedOperationalIntensityOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
state.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(state.width * state.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
state.data.state.attributes.is_collapsed) {
this.shade_node(state, ctx);
} else {
Expand All @@ -236,20 +236,20 @@ export class SimulatedOperationalIntensityOverlay extends GenericSdfgOverlay {
visible_rect.y, visible_rect.w, visible_rect.h))
return;

if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
this.shade_node(node, ctx);
} else {
if (node instanceof NestedSDFG &&
node.attributes().sdfg &&
node.attributes().sdfg.type !== 'SDFGShell') {
if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) {
const nodeppp = Math.sqrt(node.width * node.height) / ppp;
if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) {
this.shade_node(node, ctx);
}
else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') {
this.recursively_shade_sdfg(
node.data.graph, ctx, ppp, visible_rect
);
} else {
this.shade_node(node, ctx);
}
}
else {
this.shade_node(node, ctx);
}
});
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/overlays/static_flops_overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ export class StaticFlopsOverlay extends GenericSdfgOverlay {
))
return;

if (((ctx as any).lod && (ppp >= SDFV.STATE_LOD ||
state.width / ppp <= SDFV.STATE_LOD)) ||
const stateppp = Math.sqrt(state.width * state.height) / ppp;
if (((ctx as any).lod && (stateppp < SDFV.STATE_LOD)) ||
state.data.state.attributes.is_collapsed) {
this.shade_node(state, ctx);
} else {
Expand All @@ -230,20 +230,20 @@ export class StaticFlopsOverlay extends GenericSdfgOverlay {
visible_rect.y, visible_rect.w, visible_rect.h))
return;

if (node.data.node.attributes.is_collapsed ||
((ctx as any).lod && ppp >= SDFV.NODE_LOD)) {
this.shade_node(node, ctx);
} else {
if (node instanceof NestedSDFG &&
node.attributes().sdfg &&
node.attributes().sdfg.type !== 'SDFGShell') {
if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) {
const nodeppp = Math.sqrt(node.width * node.height) / ppp;
if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) {
this.shade_node(node, ctx);
}
else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') {
this.recursively_shade_sdfg(
node.data.graph, ctx, ppp, visible_rect
);
} else {
this.shade_node(node, ctx);
}
}
else {
this.shade_node(node, ctx);
}
});
}
}
Expand Down
Loading
Loading