Skip to content

Commit 3794bf2

Browse files
authored
fix(bench): modern DataHub seeding, enrichment-volume reporting, and the first published pilot results (#951)
Standing the a2 arm up on a current DataHub (v1.6.0 quickstart on OpenSearch) surfaced two harness defects, both exercised live after the fix: - The MCE emitter wrote the legacy datahub put --file bulk format, which current datahub CLIs no longer accept. Aspects are now emitted in the MCP file format (GenericAspect {"json": ...}), and bench-seed-datahub drives datahub ingest with a generated file-source recipe (BENCH_DATAHUB_GMS overrides the sink). Seed artifacts regenerated. - Suite reports summed enrichment_tokens_dedup, which is zero when enrichment runs in full mode, so the a2 arm's enrichment volume read as zero. Metrics and reports now carry enrichment_tokens_full (the delivered volume) alongside dedup, and the suite table prints the full volume. docs/reference/benchmarks.md is the new living results page (mkdocs nav + llms pair updated): phase 1 pilot manifest, arm-by-suite and trap-class tables, honest caveats, and a result-history table that future phases append to. Raw pilot run JSON (claude-sonnet-5, k=3, 60 episodes, zero harness failures) is committed under bench/results/v1.102.0-pilot/ as the first history entry. Pilot headline recorded on #930: knowledge-trap accuracy 60% (a0) vs 100% (a2) with the policy-revenue tasks going 0/6 vs 6/6, median knowledge-suite tool calls 16 vs 8, wall clock 67s vs 25s.
1 parent 1984dd2 commit 3794bf2

12 files changed

Lines changed: 1873 additions & 75 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,12 @@ bench-up: e2e-up
857857
@echo "Platform ready (pid $$(cat $(BENCH_PID)), arm $(BENCH_ARM))."
858858

859859
## bench-seed-datahub: Push bench metadata into a running DataHub quickstart (a2 arm)
860+
BENCH_DATAHUB_GMS ?= http://localhost:8080
860861
bench-seed-datahub:
861862
@command -v datahub >/dev/null 2>&1 || { echo "ERROR: datahub CLI not found (pip install acryl-datahub)"; exit 1; }
862-
datahub put --file bench/seed/datahub/bench_mces.json
863+
@mkdir -p $(BUILD_DIR)
864+
@printf 'source:\n type: file\n config:\n path: %s/bench/seed/datahub/bench_mces.json\nsink:\n type: datahub-rest\n config:\n server: %s\n' "$$(pwd)" "$(BENCH_DATAHUB_GMS)" > $(BUILD_DIR)/bench-datahub-recipe.yml
865+
datahub ingest -c $(BUILD_DIR)/bench-datahub-recipe.yml
863866

864867
## bench-run: Run the benchmark (ARM must match bench-up; LLM=anthropic|scripted, SUITE=, K=, MODEL=)
865868
bench-run:

bench/internal/auditapi/auditapi.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ type Metrics struct {
174174
TotalDurationMS int64 `json:"total_duration_ms"`
175175
// EnrichedCalls counts calls where cross-enrichment was applied.
176176
EnrichedCalls int `json:"enriched_calls"`
177-
// EnrichmentTokensDedup sums the deduplicated enrichment token volume.
177+
// EnrichmentTokensFull sums the full enrichment token volume delivered.
178+
EnrichmentTokensFull int `json:"enrichment_tokens_full"`
179+
// EnrichmentTokensDedup sums the session-deduplicated enrichment token
180+
// volume (zero when enrichment ran in full mode).
178181
EnrichmentTokensDedup int `json:"enrichment_tokens_dedup"`
179182
}
180183

@@ -189,6 +192,7 @@ func Summarize(events []Event) Metrics {
189192
m.TotalDurationMS += e.DurationMS
190193
if e.EnrichmentApplied {
191194
m.EnrichedCalls++
195+
m.EnrichmentTokensFull += e.EnrichmentTokensFull
192196
m.EnrichmentTokensDedup += e.EnrichmentTokensDedup
193197
}
194198
}

bench/internal/auditapi/auditapi_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ func TestClientErrorStatus(t *testing.T) {
163163

164164
func TestSummarize(t *testing.T) {
165165
events := []Event{
166-
{Success: true, DurationMS: 10, EnrichmentApplied: true, EnrichmentTokensDedup: 100},
166+
{Success: true, DurationMS: 10, EnrichmentApplied: true, EnrichmentTokensFull: 300, EnrichmentTokensDedup: 100},
167167
{Success: false, DurationMS: 5},
168-
{Success: true, DurationMS: 20, EnrichmentApplied: true, EnrichmentTokensDedup: 50},
168+
{Success: true, DurationMS: 20, EnrichmentApplied: true, EnrichmentTokensFull: 200, EnrichmentTokensDedup: 50},
169169
}
170170
m := Summarize(events)
171-
want := Metrics{AuditedCalls: 3, Errors: 1, TotalDurationMS: 35, EnrichedCalls: 2, EnrichmentTokensDedup: 150}
171+
want := Metrics{AuditedCalls: 3, Errors: 1, TotalDurationMS: 35, EnrichedCalls: 2, EnrichmentTokensFull: 500, EnrichmentTokensDedup: 150}
172172
if m != want {
173173
t.Errorf("Summarize = %+v, want %+v", m, want)
174174
}

bench/internal/gen/emit_datahub.go

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@ func benchURN(table string) string {
1010
return fmt.Sprintf("urn:li:dataset:(urn:li:dataPlatform:trino,memory.bench.%s,PROD)", table)
1111
}
1212

13-
// mcp is one metadata change proposal in the `datahub put --file` format the
14-
// e2e testdata uses (test/e2e/testdata/datahub/datasets.json).
13+
// mcp is one metadata change proposal in the MCP file format `datahub ingest`
14+
// consumes (file source): the aspect payload is a GenericAspect wrapped as
15+
// {"json": {...}}. The legacy `datahub put --file` bulk mode that the e2e
16+
// testdata targets no longer exists in current CLIs.
1517
type mcp struct {
16-
EntityURN string `json:"entityUrn"`
17-
EntityType string `json:"entityType"`
18-
AspectName string `json:"aspectName"`
19-
ChangeType string `json:"changeType"`
20-
Aspect any `json:"aspect"`
18+
EntityURN string `json:"entityUrn"`
19+
EntityType string `json:"entityType"`
20+
AspectName string `json:"aspectName"`
21+
ChangeType string `json:"changeType"`
22+
Aspect genericAspect `json:"aspect"`
23+
}
24+
25+
// genericAspect is the MCP file serialization of an aspect payload.
26+
type genericAspect struct {
27+
JSON any `json:"json"`
28+
}
29+
30+
// wrap boxes an aspect payload for the MCP file format.
31+
func wrap(aspect any) genericAspect {
32+
return genericAspect{JSON: aspect}
2133
}
2234

2335
// Dataset descriptions are the A2 knowledge channel: they carry the facts the
@@ -64,11 +76,11 @@ func datasetProps(table, description string, custom map[string]string) mcp {
6476
EntityType: "dataset",
6577
AspectName: "datasetProperties",
6678
ChangeType: "UPSERT",
67-
Aspect: map[string]any{
79+
Aspect: wrap(map[string]any{
6880
"name": table,
6981
"description": description,
7082
"customProperties": custom,
71-
},
83+
}),
7284
}
7385
}
7486

@@ -85,7 +97,7 @@ func editableSchema(table string, fields map[string]string) mcp {
8597
EntityType: "dataset",
8698
AspectName: "editableSchemaMetadata",
8799
ChangeType: "UPSERT",
88-
Aspect: map[string]any{"editableSchemaFieldInfo": infos},
100+
Aspect: wrap(map[string]any{"editableSchemaFieldInfo": infos}),
89101
}
90102
}
91103

@@ -96,11 +108,11 @@ func deprecation(table, note string) mcp {
96108
EntityType: "dataset",
97109
AspectName: "deprecation",
98110
ChangeType: "UPSERT",
99-
Aspect: map[string]any{
111+
Aspect: wrap(map[string]any{
100112
"deprecated": true,
101113
"note": note,
102114
"actor": "urn:li:corpuser:bench-seed",
103-
},
115+
}),
104116
}
105117
}
106118

@@ -111,6 +123,6 @@ func tag(table string) mcp {
111123
EntityType: "dataset",
112124
AspectName: "globalTags",
113125
ChangeType: "UPSERT",
114-
Aspect: map[string]any{"tags": []map[string]string{{"tag": "urn:li:tag:bench"}}},
126+
Aspect: wrap(map[string]any{"tags": []map[string]string{{"tag": "urn:li:tag:bench"}}}),
115127
}
116128
}

bench/internal/report/report.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ type SuiteSummary struct {
8080
P90ToolCalls float64 `json:"p90_tool_calls"`
8181
MedianWallMS float64 `json:"median_wall_ms"`
8282
ToolErrors int `json:"tool_errors"`
83+
EnrichmentTokensFull int `json:"enrichment_tokens_full"`
8384
EnrichmentTokensDedup int `json:"enrichment_tokens_dedup"`
8485
}
8586

@@ -165,6 +166,7 @@ func summarizeSuite(suite string, attempts []Attempt, tasks []TaskSummary) Suite
165166
toolCalls = append(toolCalls, float64(a.ToolCalls))
166167
wall = append(wall, float64(a.WallMS))
167168
s.ToolErrors += a.ToolErrors
169+
s.EnrichmentTokensFull += a.Audit.EnrichmentTokensFull
168170
s.EnrichmentTokensDedup += a.Audit.EnrichmentTokensDedup
169171
}
170172
if s.Graded > 0 {
@@ -237,7 +239,7 @@ func (r *Results) HumanSummary() string {
237239
for _, s := range r.Suites {
238240
fmt.Fprintf(&b, "%-7s %5d %6d %7.1f%% %5.1f%% %9.1f %9.1f %11.0f %9d %10d %13d\n",
239241
s.Suite, s.Tasks, s.Graded, s.Accuracy*100, s.PassKRate*100,
240-
s.MedianToolCalls, s.P90ToolCalls, s.MedianWallMS, s.ToolErrors, s.EnrichmentTokensDedup, s.HarnessFailures)
242+
s.MedianToolCalls, s.P90ToolCalls, s.MedianWallMS, s.ToolErrors, s.EnrichmentTokensFull, s.HarnessFailures)
241243
}
242244
b.WriteString("\ntask graded correct pass^k\n")
243245
for _, t := range r.Tasks {

0 commit comments

Comments
 (0)