Skip to content

Batch neighborhood traversal queries - #15

Merged
jithinmathws merged 1 commit into
mainfrom
mg-perf-neighborhood-remediation
Sep 21, 2026
Merged

jithinmathws merged 1 commit into
mainfrom
mg-perf-neighborhood-remediation

Conversation

@jithinmathws

Copy link
Copy Markdown
Collaborator

Summary

  • batch neighborhood inputs and adjacency loading by BFS traversal level
  • reduce depth-two neighborhood database queries from 150 to 12
  • preserve sequential BFS admission, deterministic ordering, scoring, explanations, uncertainty handling, graph closure, and response schema
  • add batch-equivalence and bounded-query regression tests
  • record remediation benchmark evidence and acceptance results

Performance validation

Production-count synthetic fixture:

  • 1,727 materials
  • 4,144 material-element associations
  • 128 material-application associations
  • request: material_id=1, depth=2, limit=25

Results:

  • database queries: 150 → 12
  • warm median service latency: 1,934.218 ms → 300.305 ms
  • 100 ms simulated query RTT: 17,133.475 ms → 1,543.270 ms
  • serialization: 0.244 ms
  • payload: 9,657 bytes, unchanged
  • payload SHA-256: 50f22e6a428bd19f7569f169361e71cf5d019056c23e07d75cf2af97a2f2fd11, unchanged

Validation

  • focused neighborhood tests: 15 passed
  • complete suite: 936 passed, 1 skipped
  • Ruff passed
  • dependency contract passed
  • immutable automation reference validation passed
  • git diff --check passed
  • repeated benchmark responses were deterministic

Boundaries

No production access, deployment, restart, schema change, migration, index change, provider change, or concurrency claim is included.

@jithinmathws
jithinmathws merged commit f2fc763 into main Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants