Repository navigation
Add BH #2D hardware evidence harness and lightweight N-body home page - #24
Conversation
There was a problem hiding this comment.
Sorry @EmergentMonk, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 1 day and 21 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's GuideThis PR introduces a fail-closed BH #2D real-hardware scaling harness that executes the existing GPU verifier across a source-pinned resident-body sweep, enforces correctness, determinism, hardware, oracle, and benchmark invariants, and emits hashed complete or failed manifests; accompanying tests, CI coverage, and documentation make the evidence workflow reproducible without claiming performance or production promotion. Sequence diagram for the BH #2D hardware evidence sweepsequenceDiagram
participant Runner as bench-bh2d-hardware.py
participant Git as Git
participant Verifier as galaxy-bh-gpu-tree-parallel
participant GPU as Real GPU
participant Manifest as manifest.json
Runner->>Runner: parse_particles()
Runner->>Git: git diff --quiet
Runner->>Git: git diff --cached --quiet
Runner->>Git: git rev-parse HEAD
loop Each resident-body count
Runner->>Verifier: run with --require-hardware
Verifier->>GPU: execute BH #2D workload
GPU-->>Verifier: receipt.json and runtime output
Verifier-->>Runner: completed receipt
Runner->>Runner: validate_receipt()
Runner->>Runner: sha256_file(receipt)
Runner->>Runner: sha256_file(log)
Runner->>Manifest: append validated run and hashes
end
Runner->>Manifest: mark status complete
Flow diagram for fail-closed BH #2D evidence validationflowchart TD
A[Start sweep] --> B[Validate particle counts and options]
B --> C{Dry run?}
C -->|Yes| D[Print exact verifier commands]
C -->|No| E[Require clean tracked source]
E --> F[Pin Git revision and create manifest]
F --> G[Run verifier with --require-hardware]
G --> H{Receipt passes hardware and correctness gates?}
H -->|No| I[Write failed manifest and stop]
H -->|Yes| J{Adapter matches prior runs?}
J -->|No| I
J -->|Yes| K[Hash receipt and log]
K --> L{More sweep points?}
L -->|Yes| G
L -->|No| M[Write complete source-pinned manifest]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex please review and security review the exact current head d142ca8. Focus on actionable correctness or security defects in the BH #2D hardware sweep harness, receipt validation, evidence provenance, path handling, and CI integration. Report executed vs statically inferred reproductions where applicable. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d142ca835a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex please review and security review the exact current head 2570e34. The seven earlier P2 findings are addressed with regression coverage and their threads are resolved. Report only new actionable correctness/security defects on this exact SHA; do not repeat fixed findings without a new failing case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2570e34baa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex please review and security review the exact current head a8d444c. The latest five P2 findings are fixed with dedicated regressions and their threads are resolved. Report only new actionable correctness/security defects on this exact SHA; do not repeat fixed findings without a new failing case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8d444cf32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex please review and security review the exact current head d00d223. The latest four P2 findings are fixed with dedicated regressions and their threads are resolved. Report only new actionable correctness/security defects on this exact SHA; do not repeat fixed findings without a new failing case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d00d223e15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex please review and security review the exact current head e9f0145. The latest two P1 and two P2 findings are fixed with dedicated regressions and their threads are resolved. Report only new actionable correctness/security defects on this exact SHA; do not repeat fixed findings without a new failing case. |
|
@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb46356587
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 682369c4dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex Please Review this exact SHA da9bf28 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex Please Review this exact SHA e051324 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e051324b12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def build_environment(context: dict[str, Any]) -> dict[str, str]: | ||
| env = { | ||
| key: value | ||
| for key, value in os.environ.items() | ||
| if not key.startswith("GIT_") | ||
| and key not in BUILD_ENV_EXACT | ||
| and not any(pattern.fullmatch(key) for pattern in BUILD_ENV_PATTERNS) | ||
| } |
There was a problem hiding this comment.
Bind inherited MSVC build environment inputs
Minimal reproduction (executed at helper level on this commit): set LIB=C:\attacker-libs, INCLUDE=C:\attacker-includes, LIBPATH=C:\attacker-netmodules, CL=/DCHANGED_BUILD, and _CL_=/link /DEBUG; build_environment_overrides() returns [], while build_environment() preserves all five values. Expected: native Windows capture rejects these inputs or records and binds them because MSVC uses them for library/header lookup and injected compiler/linker options. Actual: the launcher inherits them, these lines pass them to Cargo, and the manifest still reports environment_overrides: [], so a Windows verifier can be built from unrecorded inputs. The resulting native build impact is statically inferred because the reproduction host is Linux.
Useful? React with 👍 / 👎.
| require( | ||
| leaf_count <= particles, | ||
| "receipt.tree.leaf_count cannot exceed the resident particle count", |
There was a problem hiding this comment.
Require fewer leaves than particles after a bucket split
Fresh executed reproduction beyond the previously fixed topology ceilings: the checked-in 512-particle fixture with active_cell_count=1023, leaf_count=512, and max_depth=9 still returns a completed summary. Expected: rejection, because with a four-particle bucket any deepest internal cell contains at least five particles but has at most four leaf children, forcing at least one leaf to contain multiple particles and therefore leaf_count < particles. Actual: this non-strict bound accepts an impossible all-singleton-leaf tree as hardware evidence.
Useful? React with 👍 / 👎.
| "adapter_count": adapter_count, | ||
| "name": info.name, | ||
| "backend": format!("{:?}", info.backend), | ||
| "device_type": format!("{:?}", info.device_type), |
There was a problem hiding this comment.
Include hardware IDs in adapter identity
Executed identity-level reproduction: two GPU objects with identical index, count, name, backend, type, and driver strings but different vendor and device IDs produce exactly the same adapter_identity(). Expected: they are distinct adapters because the completed manifest claims one fixed adapter for the sweep. Actual: wgpu::AdapterInfo's hardware IDs are omitted here and from the validator identity, so if separate sweep processes enumerate different cards under the same generic name/driver strings and index, the adapter-change check passes; that multi-adapter impact is statically inferred.
Useful? React with 👍 / 👎.
| executable = bool(candidate.stat().st_mode & stat.S_IXUSR) | ||
| if executable != (mode == "100755"): | ||
| raise SweepError( | ||
| f"tracked source tree is dirty; executable mode changed: {relative}" | ||
| ) |
There was a problem hiding this comment.
Skip POSIX executable-bit checks on native Windows
Statically inferred native-Windows reproduction, with the repository precondition executed: git ls-files --stage reports multiple tracked .sh and .py files as mode 100755, including scripts/bench-cpu-memory-wall.sh. Expected: a clean Windows checkout accepted by Git can start the documented hardware sweep. Actual: Windows filesystems do not preserve that POSIX executable bit for these script extensions, so candidate.stat().st_mode & S_IXUSR is false and this comparison raises executable mode changed before any run begins. Make this mode check platform-aware while retaining the raw-content comparison.
Useful? React with 👍 / 👎.
Browser N-body upgrade and latest review fixes
The Pages home page now runs real planar Barnes–Hut self-gravity with 768 interacting bodies by default, selectable from 128–2,048. Glow sprites and short position-history trails supply visual density without adding simulated mass. It includes encounter/disc/collapse presets, orbit/zoom controls, pause/single-step, a tree overlay and a pause-and-audit action. Physics timing is independent of monitor refresh rate; reduced-motion preference starts paused. The previous rotation-law instrument is preserved at
rotation-lab.html, and the detailed tree lab remains atbarnes-hut.html.The eight latest review findings are addressed: isolated Python launch, sanitized system build PATH, selected toolchain hashes behind symlinked/hardlinked rustup proxies, raw-byte run logs, finite/ranged CLI validation and strict manifest JSON, normalized integer-limit parsing errors, cleared Git selectors with explicit checkout binding, and repository-relative CARGO_HOME resolution.
Validation:
Summary
Implements the remaining N-body-related deferred work that is actionable in-repo after merged PR #23: a fail-closed real-hardware BH #2D scaling/evidence harness.
The historical PE #15 deferred backlog remains untouched because it belongs to the prescribed-field/CPU-memory programme rather than the resident Barnes–Hut self-gravity line.
What this adds
scripts/bench-bh2d-hardware.pygalaxy-bh-gpu-tree-parallel --require-hardware;galaxy.bh2d-hardware-scaling-manifest.v1manifest;host-side unit tests for the sweep receipt contract;
native-GPU CI coverage for the tests and dry-run command construction;
README, roadmap and Barnes–Hut/GPU runtime documentation.
Claim boundary
This PR does not invent or claim hardware performance evidence. Mesa/software Vulkan remains validation-only.
BH #2D remains evidence-pending until the harness is actually run on a real GPU. A completed manifest is evidence only for its recorded source, workload and adapter; BH #2E production promotion remains a separate decision.
Deliberately still deferred
The historical PE #15 backlog—heterogeneous prescribed-field CPU+GPU execution, NUMA work, multi-GPU deterministic sharding, output pipelines, symmetry compression, etc.—is unchanged.
Summary by Sourcery
Establish a fail-closed harness for capturing and validating reproducible real-GPU BH #2D scaling evidence without making automatic performance or production-promotion claims.
New Features:
Enhancements:
CI:
Documentation:
Tests: