Skip to content

Commit 20a5a46

Browse files
Add scoped impact ranking benchmark results
* Add impact analysis benchmark harness * Keep benchmark harness separate from results * Add scoped impact ranking benchmark results --------- Co-authored-by: jonathanpopham <jonathan.popham@gmail.com>
1 parent 3db11ba commit 20a5a46

33 files changed

Lines changed: 23849 additions & 0 deletions
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Real Impact Ranking Result: API 50c6ae58
2+
3+
This result records the 10-repository scoped impact-ranking run against the public API implementation at `50c6ae58e408fabcd8a4b36f960b0988f5804432`.
4+
5+
It is intentionally separate from the benchmark harness PR. The harness lives in `benchmark/agent-impact`; this directory is the evidence bundle for one run.
6+
7+
## Run Identity
8+
9+
- Generated: `2026-05-08T20:09:31.845Z`
10+
- CLI branch: `impact-analysis-benchmark`
11+
- CLI commit used for this artifact branch base: `3738a6381c156f3aef19261a88b38337653296ab`
12+
- API branch: `impact-analysis-api-fixes`
13+
- API commit: `50c6ae58e408fabcd8a4b36f960b0988f5804432`
14+
- Node: `v24.3.0`
15+
- npm: `11.4.2`
16+
- Manifest: `benchmark/agent-impact/post-cutoff-prs.json`
17+
- Scope: `replay-dirs`
18+
- Cases: 10
19+
20+
The ranking runner imports the local public API data-plane implementation directly through `SUPERMODEL_PUBLIC_API_REPO`. It does not call the hosted API. Public endpoint compatibility is covered by the API PR tests and smoke scripts.
21+
22+
## Reproduce
23+
24+
Check out the API branch and install data-plane dependencies:
25+
26+
```bash
27+
git clone git@github.com:supermodeltools/supermodel-public-api.git
28+
cd supermodel-public-api
29+
git checkout impact-analysis-api-fixes
30+
git rev-parse HEAD
31+
32+
cd src/data-plane
33+
npm install
34+
```
35+
36+
Check out the CLI benchmark harness:
37+
38+
```bash
39+
git clone git@github.com:supermodeltools/cli.git
40+
cd cli
41+
git checkout impact-analysis-benchmark
42+
git rev-parse HEAD
43+
```
44+
45+
Run the benchmark:
46+
47+
```bash
48+
export SUPERMODEL_PUBLIC_API_REPO=/absolute/path/to/supermodel-public-api
49+
50+
node benchmark/agent-impact/run-real-impact-ranking.mjs \
51+
--out-dir target/real-impact-ranking-opt-in-50c6ae58 \
52+
--scope replay-dirs
53+
```
54+
55+
The runner clones the pinned public repositories from `post-cutoff-prs.json`, checks out each PR base SHA, applies the PR regression files from the merge commit, withholds the production fix, builds a scoped graph, and scores the generated `validationFiles` against the hidden PR regression-file labels.
56+
57+
The full local output includes cloned repositories under `target/`, which is intentionally not checked in. This artifact keeps only:
58+
59+
- `report.md`
60+
- sanitized `summary.json`
61+
- per-case `IMPACT_ANALYSIS_SCOPED.md`
62+
- per-case `impact-analysis.scoped.json`
63+
- per-case `reference-production.diff`
64+
65+
## Headline Result
66+
67+
The headline comparison uses the same 10 post-cutoff PR cases and the same 21 labeled regression files.
68+
69+
| Method | Precision | Recall | F1 | Correct / Expected | Predicted |
70+
|---|---:|---:|---:|---:|---:|
71+
| Baseline path/name matcher | 0.060 | 0.286 | 0.099 | 6 / 21 | 100 |
72+
| Supermodel best scoped packet | 0.274 | 0.952 | 0.426 | 20 / 21 | 73 |
73+
74+
Interpretation: Supermodel recovered 20 of 21 labeled validation files versus 6 of 21 for the naive path/name baseline, while returning fewer candidates. The strongest claim here is recall: scoped impact analysis finds relevant validation files that simple proximity misses. Precision still needs work.
75+
76+
## Per-Repo Summary
77+
78+
| Repo / PR | Expected | Baseline F1 | Supermodel F1 | Supermodel Correct | Supermodel Candidates |
79+
|---|---:|---:|---:|---:|---:|
80+
| Next.js #93417 | 4 | 0.000 | 0.615 | 4 / 4 | 9 |
81+
| VS Code #314217 | 1 | 0.182 | 0.333 | 1 / 1 | 5 |
82+
| MUI #48472 | 1 | 0.182 | 1.000 | 1 / 1 | 1 |
83+
| Grafana #123935 | 1 | 0.182 | 0.200 | 1 / 1 | 9 |
84+
| React #36047 | 1 | 0.000 | 0.200 | 1 / 1 | 9 |
85+
| Angular #68512 | 1 | 0.000 | 0.400 | 1 / 1 | 4 |
86+
| Prisma #29512 | 5 | 0.133 | 0.714 | 5 / 5 | 9 |
87+
| Payload #16465 | 5 | 0.000 | 0.571 | 4 / 5 | 9 |
88+
| Superset #39504 | 1 | 0.182 | 0.200 | 1 / 1 | 9 |
89+
| Terraform #38338 | 1 | 0.182 | 0.200 | 1 / 1 | 9 |
90+
91+
## Notes
92+
93+
The benchmark is scoped by design. It asks: "if this production file or function changes, which validation files should be inspected or run first?" It is not trying to return the impact of every file in the repository.
94+
95+
The checked-in `summary.json` has local absolute paths replaced with `<cli-repo>` and `<public-api-repo>`. The raw cloned repositories and local caches are excluded from the artifact.

benchmark/agent-impact/results/real-impact-ranking-opt-in-50c6ae58/cases/angular-68512-async-validator-pending/IMPACT_ANALYSIS_SCOPED.md

Lines changed: 110 additions & 0 deletions
Large diffs are not rendered by default.

benchmark/agent-impact/results/real-impact-ranking-opt-in-50c6ae58/cases/angular-68512-async-validator-pending/impact-analysis.scoped.json

Lines changed: 838 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
diff --git a/packages/core/src/core_private_export.ts b/packages/core/src/core_private_export.ts
2+
index c2237d9ec0..00692f1630 100644
3+
--- a/packages/core/src/core_private_export.ts
4+
+++ b/packages/core/src/core_private_export.ts
5+
@@ -153,6 +153,7 @@ export {
6+
SharedStylesHost as ɵSharedStylesHost,
7+
} from './render3/interfaces/shared_styles_host';
8+
export {
9+
+ chain as ɵchain,
10+
encapsulateResourceError as ɵencapsulateResourceError,
11+
ResourceImpl as ɵResourceImpl,
12+
} from './resource/resource';
13+
diff --git a/packages/core/src/resource/resource.ts b/packages/core/src/resource/resource.ts
14+
index dad83f1412..3655ea3881 100644
15+
--- a/packages/core/src/resource/resource.ts
16+
+++ b/packages/core/src/resource/resource.ts
17+
@@ -598,19 +598,21 @@ class ResourceWrappedError extends Error {
18+
* of the other resource if it is available, or propagating the status to the current resource if it
19+
* is not.
20+
*/
21+
+export function chain<T>(resource: Resource<T>): T {
22+
+ switch (resource.status()) {
23+
+ case 'idle':
24+
+ throw ResourceParamsStatus.IDLE;
25+
+ case 'error':
26+
+ throw new ResourceDependencyError(resource);
27+
+ case 'loading':
28+
+ case 'reloading':
29+
+ throw ResourceParamsStatus.LOADING;
30+
+ }
31+
+ return resource.value();
32+
+}
33+
+
34+
export const paramsContext: ResourceParamsContext = {
35+
- chain<T>(resource: Resource<T>): T {
36+
- switch (resource.status()) {
37+
- case 'idle':
38+
- throw ResourceParamsStatus.IDLE;
39+
- case 'error':
40+
- throw new ResourceDependencyError(resource);
41+
- case 'loading':
42+
- case 'reloading':
43+
- throw ResourceParamsStatus.LOADING;
44+
- }
45+
- return resource.value();
46+
- },
47+
+ chain,
48+
};
49+
50+
let inParamsFunction = false;
51+
diff --git a/packages/forms/signals/src/api/rules/validation/validate_async.ts b/packages/forms/signals/src/api/rules/validation/validate_async.ts
52+
index 8785386475..ad3feb196c 100644
53+
--- a/packages/forms/signals/src/api/rules/validation/validate_async.ts
54+
+++ b/packages/forms/signals/src/api/rules/validation/validate_async.ts
55+
@@ -6,7 +6,15 @@
56+
* found in the LICENSE file at https://angular.dev/license
57+
*/
58+
59+
-import {DebounceTimer, ResourceRef, ResourceSnapshot, Signal, debounced} from '@angular/core';
60+
+import {
61+
+ computed,
62+
+ DebounceTimer,
63+
+ ResourceRef,
64+
+ ResourceSnapshot,
65+
+ Signal,
66+
+ debounced,
67+
+ ɵchain,
68+
+} from '@angular/core';
69+
import {FieldNode} from '../../../field/node';
70+
import {addDefaultField} from '../../../field/validation';
71+
import {FieldPathNode} from '../../../schema/path_node';
72+
@@ -127,7 +135,8 @@ export function validateAsync<TValue, TParams, TResult, TPathKind extends PathKi
73+
(_state, params) => {
74+
if (opts.debounce !== undefined) {
75+
const debouncedResource = debounced(() => params(), opts.debounce);
76+
- return opts.factory(debouncedResource.value);
77+
+ const wrappedParams = computed(() => ɵchain(debouncedResource));
78+
+ return opts.factory(wrappedParams);
79+
}
80+
return opts.factory(params);
81+
},
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Scoped Impact Analysis
2+
3+
Generated by: `supermodel-real-scoped-impact-ranking`
4+
5+
Repository: `grafana/grafana`
6+
7+
Scope: `replay-dirs`
8+
9+
Generated by the local data-plane impact implementation for replay analysis. If diff-derived function targets are present, this benchmark used reference-production.diff; production use should pass user-supplied targets/diffs.
10+
11+
## single-production-file-target->tests:pkg/services/ngalert/store/alert_rule.go
12+
13+
Targets:
14+
`pkg/services/ngalert/store/alert_rule.go`
15+
16+
Structurally affected files:
17+
`pkg/services/ngalert/store/provisioning_store_test.go`, `pkg/services/ngalert/store/image_test.go`
18+
19+
Validation files to inspect or run first:
20+
- `pkg/services/ngalert/store/alert_rule_test.go` (high, score 302) — paired test filename; same directory; mentions changed symbol; shares change terms: optimistic, lock, delete, alert, rule, uid, version, increase; filename shares diff terms: alert, rule
21+
- `pkg/services/ngalert/store/image_test.go` (high, score 267) — structural reverse dependency; same directory; mentions changed symbol; shares change terms: delete, interval, dbstore, sess, session, int64, where, same; path contains compound diff terms: alert
22+
- `pkg/services/ngalert/store/provisioning_store_test.go` (high, score 253) — structural reverse dependency; same directory; mentions changed symbol; shares change terms: lock, delete, alert, rule, uid, update, group, uids; path contains compound diff terms: alert
23+
- `pkg/services/ngalert/store/alert_rule_backfill_test.go` (high, score 216) — same directory; mentions changed symbol; shares change terms: alert, rule, uid, namespace, folder, fullpath, update, list; filename shares diff terms: alert, rule; content contains compound diff terms: note, here
24+
- `pkg/services/ngalert/store/deltas_test.go` (high, score 207) — same directory; mentions changed symbol; shares change terms: delete, alert, rule, uid, version, namespace, folder, update; path contains compound diff terms: alert; content contains compound diff terms: ngmodel, sess, note, here
25+
- `pkg/services/ngalert/store/alert_rule_labels_test.go` (high, score 203) — same directory; mentions changed symbol; shares change terms: alert, build, condition, matcher, label, prometheu, origin, sql; filename shares diff terms: alert, rule; content contains compound diff terms: note
26+
- `pkg/services/ngalert/store/namespace_test.go` (high, score 203) — same directory; mentions changed symbol; shares change terms: uid, namespace, folder, list, uids, org, title, existing; filename shares diff terms: namespace; path contains compound diff terms: alert
27+
- `pkg/services/ngalert/store/alertmanager_test.go` (high, score 191) — same directory; mentions changed symbol; shares change terms: delete, alert, version, latest, update, deleted, org, existing; path contains compound diff terms: alert; content contains compound diff terms: note, here
28+
- `pkg/services/ngalert/store/range_to_instant_test.go` (high, score 191) — same directory; mentions changed symbol; shares change terms: alert, rule, uid, query, interval, point, prometheu, invalid; path contains compound diff terms: alert; content contains compound diff terms: ngmodel, here
29+
- `pkg/services/ngalert/store/admin_configuration_test.go` (high, score 183) — same directory; mentions changed symbol; shares change terms: alert, update, org, insert, existing, sql, dbstore, ngmodel; path contains compound diff terms: alert; content contains compound diff terms: here
30+
31+
Primary validation files:
32+
- none
33+
34+
## single-production-function-target->tests:pkg/services/ngalert/store/alert_rule.go:ListAlertRulesByGroup
35+
36+
Targets:
37+
`pkg/services/ngalert/store/alert_rule.go:ListAlertRulesByGroup`
38+
39+
Structurally affected files:
40+
_none_
41+
42+
Validation files to inspect or run first:
43+
- `pkg/services/ngalert/store/alert_rule_test.go` (high, score 302) — paired test filename; same directory; mentions changed symbol; shares change terms: list, alert, rule, group, dbstore, query, cursor, condition; filename shares diff terms: alert, rule
44+
- `pkg/services/ngalert/store/alert_rule_backfill_test.go` (high, score 156) — same directory; shares change terms: list, alert, rule, org, sess, session, int64, uid; filename shares diff terms: alert, rule; content contains compound diff terms: note, here
45+
- `pkg/services/ngalert/store/deltas_test.go` (high, score 147) — same directory; shares change terms: list, alert, rule, group, query, condition, org, int64; path contains compound diff terms: alert; content contains compound diff terms: ngmodel, sess, note, here
46+
- `pkg/services/ngalert/store/namespace_test.go` (high, score 143) — same directory; shares change terms: list, dbstore, org, int64, uid, folder, namespace, sql; filename shares diff terms: namespace; path contains compound diff terms: alert; content contains compound diff terms: alert
47+
- `pkg/services/ngalert/store/compat_test.go` (high, score 123) — same directory; shares change terms: alert, rule, group, query, ngmodel, condition, org, uid; path contains compound diff terms: alert; content contains compound diff terms: note
48+
- `pkg/services/ngalert/store/instance_database_test.go` (high, score 123) — same directory; shares change terms: list, alert, rule, group, dbstore, query, condition, org; path contains compound diff terms: alert; content contains compound diff terms: ngmodel
49+
- `pkg/services/ngalert/store/proto_instance_database_test.go` (high, score 123) — same directory; shares change terms: alert, rule, group, condition, org, int64, uid, append; path contains compound diff terms: alert; content contains compound diff terms: note
50+
- `pkg/services/ngalert/store/image_test.go` (high, score 117) — same directory; shares change terms: dbstore, sess, session, int64, where, same; path contains compound diff terms: alert; content contains compound diff terms: alert, query, note, here
51+
- `pkg/services/ngalert/store/instance_database_bench_test.go` (high, score 113) — same directory; shares change terms: alert, rule, group, dbstore, org, int64, uid, append; path contains compound diff terms: alert; content contains compound diff terms: ngmodel
52+
- `pkg/services/ngalert/store/provisioning_store_test.go` (high, score 113) — same directory; shares change terms: alert, rule, group, dbstore, org, int64, uid, same; path contains compound diff terms: alert; content contains compound diff terms: sess
53+
54+
Primary validation files:
55+
- none
56+
57+
## single-production-function-target->tests:pkg/services/ngalert/store/alert_rule.go:buildGroupCursorCondition
58+
59+
Targets:
60+
`pkg/services/ngalert/store/alert_rule.go:buildGroupCursorCondition`
61+
62+
Structurally affected files:
63+
`pkg/services/ngalert/store/alert_rule.go`
64+
65+
Validation files to inspect or run first:
66+
- `pkg/services/ngalert/store/alert_rule_test.go` (high, score 242) — paired test filename; same directory; shares change terms: group, cursor, condition, dbstore, list, alert, rule, query; filename shares diff terms: alert, rule; content contains compound diff terms: ngmodel, select, note, here
67+
- `pkg/services/ngalert/store/alert_rule_backfill_test.go` (high, score 156) — same directory; shares change terms: list, alert, rule, org, sess, session, int64, uid; filename shares diff terms: alert, rule; content contains compound diff terms: note, here
68+
- `pkg/services/ngalert/store/deltas_test.go` (high, score 147) — same directory; shares change terms: group, condition, list, alert, rule, query, org, int64; path contains compound diff terms: alert; content contains compound diff terms: ngmodel, sess, note, here
69+
- `pkg/services/ngalert/store/namespace_test.go` (high, score 143) — same directory; shares change terms: dbstore, list, org, int64, uid, folder, namespace, sql; filename shares diff terms: namespace; path contains compound diff terms: alert; content contains compound diff terms: alert
70+
- `pkg/services/ngalert/store/compat_test.go` (high, score 123) — same directory; shares change terms: group, condition, alert, rule, query, ngmodel, org, uid; path contains compound diff terms: alert; content contains compound diff terms: note
71+
- `pkg/services/ngalert/store/instance_database_test.go` (high, score 123) — same directory; shares change terms: group, condition, dbstore, list, alert, rule, query, org; path contains compound diff terms: alert; content contains compound diff terms: ngmodel
72+
- `pkg/services/ngalert/store/proto_instance_database_test.go` (high, score 123) — same directory; shares change terms: group, condition, alert, rule, org, int64, uid, append; path contains compound diff terms: alert; content contains compound diff terms: note
73+
- `pkg/services/ngalert/store/image_test.go` (high, score 117) — same directory; shares change terms: dbstore, sess, session, int64, where, same; path contains compound diff terms: alert; content contains compound diff terms: alert, query, note, here
74+
- `pkg/services/ngalert/store/instance_database_bench_test.go` (high, score 113) — same directory; shares change terms: group, dbstore, alert, rule, org, int64, uid, append; path contains compound diff terms: alert; content contains compound diff terms: ngmodel
75+
- `pkg/services/ngalert/store/provisioning_store_test.go` (high, score 113) — same directory; shares change terms: group, dbstore, alert, rule, org, int64, uid, same; path contains compound diff terms: alert; content contains compound diff terms: sess
76+
77+
Primary validation files:
78+
- none
79+

0 commit comments

Comments
 (0)