Prototype geometry-driven rich graph renderer

This commit is contained in:
Meta Vens 2026-04-25 09:09:30 +01:00
commit b1a7bae1da
13 changed files with 3742 additions and 0 deletions

87
benchmarks/README.md Normal file
View file

@ -0,0 +1,87 @@
# EpiphanyGraph Benchmarks
These benchmarks measure whether a rendered graph helps a vision-capable agent recover useful graph truth.
This is not a beauty contest. If a candidate looks cool but does not improve correct answers, it is decorative trash in a nice hat.
## Local Workflow
Generate a benchmark run:
```powershell
.\scripts\New-BenchmarkRun.ps1
```
The script creates a timestamped run under `out/benchmarks/`, renders every candidate from the benchmark spec, and writes a review sheet for each candidate.
Review one candidate at a time:
1. Open the candidate PNG listed in `answer-sheet.md`.
2. Answer the blind probe questions before reading any gold data.
3. Treat the SVG as vector reference only, not as the primary image input.
4. Use the layout JSON only when a probe says JSON is allowed.
5. Copy `scores.template.json` to `scores.json`.
6. Fill in the per-probe scores after comparing your answers against the run-level `gold.json`.
Each candidate render directory may also contain sibling `*.msagl.svg` and `*.rich.svg` files. During blind review, ignore those. The candidate under test is always the primary `source-tree.svg` / `control-flow.svg` pair plus their PNG previews.
Aggregate manual scores:
```powershell
.\scripts\Measure-BenchmarkRun.ps1 -RunDir .\out\benchmarks\aetheria-source-tree-map\<run-id>
```
## Benchmark Shape
Each benchmark contains:
- `*.benchmark.json`: corpus path, graph entry note, and render candidates
- `questions.json`: blind probes shown to the evaluator
- `gold.json`: expected answers and scoring criteria
The generated run contains:
- `run-manifest.json`: run metadata and candidate outputs
- `gold.json`: scoring key, kept out of per-candidate answer sheets
- `candidates/<candidate-id>/render/`: EpiphanyGraph outputs
- `candidates/<candidate-id>/render/*.png`: raster previews for image probes
- `candidates/<candidate-id>/render/*.msagl.svg`: preserved stock baseline output
- `candidates/<candidate-id>/render/*.rich.svg`: preserved custom renderer output
- `candidates/<candidate-id>/answer-sheet.md`: blind review sheet
- `candidates/<candidate-id>/scores.template.json`: manual scoring skeleton
## Input Modes
Probe questions declare allowed inputs.
- `image`: answer from the rendered SVG only
- `json`: inspect layout JSON or graph data
- `image+json`: use the visual first, then verify against JSON
The useful benchmark result is the delta between these modes. If the image does not help the evaluator answer graph questions better, the render is just wallpaper with arrows.
## Current Corpus
`aetheria-economy/source-tree-map.benchmark.json` targets:
```text
E:\Projects\Aetheria-Economy\Aetheria\Source Tree Map
```
It exercises the current EpiphanyGraph partition output:
- `source-tree.svg` and `source-tree.json`
- `control-flow.svg` and `control-flow.json`
- `cross-links.json`
## Scoring
Start with simple manual scoring. Automation can come later after the probes stop wriggling.
Use:
- `1.0`: correct and specific
- `0.5`: partially correct, vague, or missing one key element
- `0.0`: wrong, hallucinated, or unsupported by the allowed inputs
Diagnostic probes may have `maxScore` set to `0`. They are useful notes, not leaderboard bait.

View file

@ -0,0 +1,125 @@
{
"benchmark": "aetheria-source-tree-map",
"sourceMaterial": [
"E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map\\Source Tree Map.md",
"E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map\\Control Flow Map.md",
"E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map\\Economy Server Control Flow.md",
"E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map\\Unity Client\\Scripts\\Gameplay Session Control Flow.md",
"E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map\\Unity Client\\Scripts\\Simulation Tick Control Flow.md",
"E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map\\Unity Client\\Scripts\\Player Input and Weapons Control Flow.md"
],
"probes": {
"source-top-split": {
"expected": [
"Unity Client",
"Economy Server",
"Data Audio and Authoring",
"Third Party and Config"
],
"scoring": "Full credit for all four major branches. Half credit for three correct branches or for substituting a direct child note that clearly belongs to one branch."
},
"source-authoring-cluster": {
"expected": [
"Data Audio and Authoring",
"GameData",
"Wwise Project",
"Asset Sources and Root Artifacts"
],
"scoring": "Full credit for naming Data Audio and Authoring and at least one correct child. Half credit for naming only a child without the parent branch."
},
"source-rendering-path": {
"expected": [
"Unity Client",
"Rendering and Content",
"Shaders and Compute"
],
"scoring": "Full credit for the complete path. Half credit for identifying Shaders and Compute but missing one parent."
},
"source-shared-simulation-hub": {
"expected": {
"node": "Unity Client/Scripts/Shared Simulation",
"degreeRank": "Major shared-code hub in the source-tree baseline JSON. Unity Client/Scripts has the highest non-root total degree, but Shared Simulation is the key shared runtime hub.",
"baselineDegree": {
"in": 8,
"out": 6,
"total": 14
}
},
"scoring": "Full credit for Shared Simulation with JSON degree support. Half credit for Shared Simulation Core or Shared Behaviors if the answer explains the shared-code hub correctly but misses the exact highest-degree node."
},
"source-generated-config-branch": {
"expected": [
"Third Party and Config",
"Project Config Shared Math and Generated State"
],
"scoring": "Full credit for either the parent branch plus the generated-state child, or the generated-state child alone with a clear explanation."
},
"control-root-children": {
"expected": [
"Gameplay Session Control Flow",
"Player Input and Weapons Control Flow",
"Simulation Tick Control Flow",
"Entity Equipment and Persistence Flow",
"Zone View Control Flow",
"Agent Combat Control Flow",
"Client Networking Control Flow",
"Economy Server Control Flow",
"CultCache Bootstrap and Data Load Flow",
"Galaxy and Zone Generation Control Flow",
"Narrative Placement Control Flow"
],
"scoring": "Full credit for eight or more correct major control-flow notes with no major hallucinations. Half credit for five to seven."
},
"control-central-hub": {
"expected": {
"node": "Galaxy and Zone Generation Control Flow",
"degreeRank": "Highest non-root total degree in the current control-flow baseline JSON.",
"baselineDegree": {
"in": 6,
"out": 8,
"total": 14
}
},
"scoring": "Full credit for Galaxy and Zone Generation Control Flow with JSON degree support. Half credit for Simulation Tick Control Flow if the answer correctly identifies it as another major hub but not the top one in the current baseline."
},
"control-network-bridge": {
"expected": [
"Client Networking Control Flow",
"Economy Server Control Flow"
],
"scoring": "Full credit for both notes. Half credit for naming only one side and describing the client/server network edge correctly."
},
"control-player-to-simulation-chain": {
"expected": [
"Gameplay Session Control Flow",
"Player Input and Weapons Control Flow",
"Simulation Tick Control Flow",
"Entity Equipment and Persistence Flow",
"Zone View Control Flow"
],
"scoring": "Full credit for the core chain from gameplay session through input into simulation and equipment or rendering consequences. Half credit for a plausible partial chain with at least three correct nodes in order."
},
"cross-economy-server-anchor": {
"expected": {
"controlFlow": "Economy Server Control Flow",
"sourceTreeAnchor": "Economy Server"
},
"scoring": "Full credit for mapping Economy Server Control Flow to Economy Server. Half credit if the answer names Economy.Server/ files but misses the source-tree note."
},
"cross-gameplay-session-anchor": {
"expected": {
"controlFlow": "Gameplay Session Control Flow",
"sourceTreeAnchor": "Unity Client/Scripts/Gameplay Runtime"
},
"scoring": "Full credit for mapping Gameplay Session Control Flow to Gameplay Runtime. Half credit for naming ActionGameManager.cs or Unity Client/Scripts without the source-tree note."
},
"diagnostic-legibility-failures": {
"expected": "Diagnostic only.",
"scoring": "No score."
},
"diagnostic-image-vs-json": {
"expected": "Diagnostic only.",
"scoring": "No score."
}
}
}

View file

@ -0,0 +1,136 @@
{
"benchmark": "aetheria-source-tree-map",
"instructions": "Answer from the allowed inputs only. For image probes, inspect the PNG preview before opening JSON. Use SVG only as vector reference if needed, not as the primary image input. Do not read gold.json until after answers are written.",
"probes": [
{
"id": "source-top-split",
"graph": "source-tree",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "From the source-tree rendering, name the four major branches directly under Source Tree Map.",
"answerFormat": "List four note titles."
},
{
"id": "source-authoring-cluster",
"graph": "source-tree",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "Which source-tree branch owns GameData, Wwise, raw art sources, and stray authoring artifacts?",
"answerFormat": "Name the branch and one or two visible child notes that support the answer."
},
{
"id": "source-rendering-path",
"graph": "source-tree",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "Which visible source-tree path leads to shader and compute work?",
"answerFormat": "Give the path using note titles."
},
{
"id": "source-shared-simulation-hub",
"graph": "source-tree",
"allowedInputs": [
"image+json"
],
"maxScore": 1,
"question": "Which non-root source-tree node appears to be a major shared-code hub, and does the JSON degree data support that impression?",
"answerFormat": "Name the node, describe the visual cue, then cite its degree or relative degree rank from JSON."
},
{
"id": "source-generated-config-branch",
"graph": "source-tree",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "Where does generated or local editor/build state belong in the source-tree map?",
"answerFormat": "Name the branch or child note."
},
{
"id": "control-root-children",
"graph": "control-flow",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "From the control-flow rendering, list the major execution-order notes attached to Control Flow Map.",
"answerFormat": "List as many direct major control-flow notes as the image makes readable."
},
{
"id": "control-central-hub",
"graph": "control-flow",
"allowedInputs": [
"image+json"
],
"maxScore": 1,
"question": "Ignoring the root Control Flow Map node, which control-flow node is the most central hub, and how does JSON support that?",
"answerFormat": "Name the node and cite its degree or relative rank."
},
{
"id": "control-network-bridge",
"graph": "control-flow",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "Which two control-flow notes describe the client/server network edge?",
"answerFormat": "Name both notes."
},
{
"id": "control-player-to-simulation-chain",
"graph": "control-flow",
"allowedInputs": [
"image"
],
"maxScore": 1,
"question": "What visible control-flow chain carries player action toward simulation consequences?",
"answerFormat": "List the main note titles in order."
},
{
"id": "cross-economy-server-anchor",
"graph": "cross-view",
"allowedInputs": [
"image+json"
],
"maxScore": 1,
"question": "Which source-tree note should anchor Economy Server Control Flow in a future linked-view renderer?",
"answerFormat": "Name the control-flow note and its source-tree anchor."
},
{
"id": "cross-gameplay-session-anchor",
"graph": "cross-view",
"allowedInputs": [
"image+json"
],
"maxScore": 1,
"question": "Which source-tree note should anchor Gameplay Session Control Flow in a future linked-view renderer?",
"answerFormat": "Name the control-flow note and its source-tree anchor."
},
{
"id": "diagnostic-legibility-failures",
"graph": "all",
"allowedInputs": [
"image"
],
"maxScore": 0,
"question": "Which labels, edge paths, clusters, or crossings were hard to read from the image alone?",
"answerFormat": "Freeform diagnostic notes. No score."
},
{
"id": "diagnostic-image-vs-json",
"graph": "all",
"allowedInputs": [
"image+json"
],
"maxScore": 0,
"question": "What did the image make obvious, and what required JSON verification?",
"answerFormat": "Two short lists: image-obvious and JSON-required."
}
]
}

View file

@ -0,0 +1,54 @@
{
"name": "aetheria-source-tree-map",
"description": "Aetheria-Economy source-tree and control-flow note graph benchmark.",
"vaultRoot": "E:\\Projects\\Aetheria-Economy\\Aetheria\\Source Tree Map",
"entryNote": "Source Tree Map",
"includeUnreachable": false,
"questionsPath": "questions.json",
"goldPath": "gold.json",
"candidates": [
{
"id": "sugiyama-msagl",
"layout": "sugiyama",
"renderer": "msagl",
"description": "Baseline layered MSAGL layout with stock renderer."
},
{
"id": "sugiyama-rich",
"layout": "sugiyama",
"renderer": "rich",
"description": "Layered layout with custom renderer over MSAGL geometry."
},
{
"id": "mds-msagl",
"layout": "mds",
"renderer": "msagl",
"description": "Baseline MDS layout with stock renderer."
},
{
"id": "mds-rich",
"layout": "mds",
"renderer": "rich",
"description": "MDS layout with custom renderer over MSAGL geometry."
}
],
"futureSweepAxes": {
"layout": [
"nodeSeparation",
"layerSeparation",
"edgeRoutingMode",
"aspectRatio",
"pinnedAnchors"
],
"renderer": [
"backgroundColor",
"fontSize",
"labelWrapWidth",
"nodePadding",
"edgeOpacity",
"semanticPalette",
"clusterBoundaries"
],
"note": "These are not all wired into the current CLI yet. Keep them in the spec so the harness has a place for them when the renderer grows up."
}
}