Skip to content

feat: add /physics-proof live benchmark endpoint#4

Closed
SarmaHighOnCode wants to merge 1 commit intomainfrom
feature/physics-proof-endpoint
Closed

feat: add /physics-proof live benchmark endpoint#4
SarmaHighOnCode wants to merge 1 commit intomainfrom
feature/physics-proof-endpoint

Conversation

@SarmaHighOnCode
Copy link
Owner

Description

Adds a /physics-proof GET endpoint that runs live physics engine benchmarks (energy conservation, batch propagation speed, KDTree performance, Tsiolkovsky fuel precision, J2 RAAN regression) and reports pass/fail results. Intended for the dashboard 'Physics Proof' button.

Domain

  • API Layer (backend/api/, main.py, schemas.py, Dockerfile)

Changes

  • backend/api/physics_proof.py [NEW] — defines /physics-proof route with 6 benchmarks and engine state reporting.

Known Limitations

Warning

The following should be addressed before merging to production:

  • No rate limiting — each request runs expensive benchmarks (1K-object propagation, 10K-point KDTree). Could cause load issues if spammed.
  • No caching — results are recomputed on every call; consider caching results for a short TTL.
  • Hardcoded test count — line 130 returns a static string 1,163 pytest tests (all passing) that is not verified at runtime.
  • Owner attribution — docstring says Owner: Dev 1 (Physics Engine); confirm this is correct.

Testing

  • Unit tests pass (pytest backend/tests/ -v)
  • Docker build succeeds (docker build -t acm-orbital .)
  • Manual verification completed

Checklist

  • All constants imported from config.py.
  • No O(N^2) loops in physics code.
  • All physics functions have corresponding tests.

@SarmaHighOnCode
Copy link
Owner Author

Closing PR due to severe performance and security concerns. The endpoint lacks rate limiting (introducing a DoS risk) and runs heavy computations synchronously which will block the FastAPI event loop. Additionally, it returns hardcoded/fake test metrics and lacks automated tests.

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.

1 participant