Repository navigation
feat: qualify real AI pressure components and bounded trajectories - #49
Merged
Merged
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rheon can execute the real surrogate-lab pressure model as an opt-in solver component. Every prediction is checked against the full pressure residual and predicted-divergence gates; unsupported requests, inference errors and rejected output retain a reason and use the selected Jacobi or SGS reference. Independently evolved full trajectories now qualify the selected backend and fallback behavior.
The isolated
rheon::solver_providerAPI exposes pressure requests, capabilities, version/stage/shape/layout/units metadata, model provenance and invocation timing. Native f64 inference uses the frozen learned gains and basis directly. The exporter verifies checkpoint SHA256 and never executes pickle or trains a model. The core remains standard-library-only.Compatibility and integration
2209012bc5f902693d0f695ec1c2d854126af317.25533a2fbaa5ab0f5fb574dc6307a2b8d6a686deb7db867d0d03338d4d70d5a9.Simulationand desktop defaults remain available. The provider API is ready for the API owner's selection hook; this PR qualifies an explicit component loop using Rheon's real advection, pressure, correction and tracer kernels. It does not claim the existing desktop has provider selection.Bounded full-trajectory qualification
The experiment was fixed in
plan.mdbefore execution: 24 frames (0.4 simulated seconds), public lab seeds 900/901, three rotated timing repetitions, followed by a separate full-field capture replay. Each mode evolves its own accepted state; no teacher states enter learned rollouts. These are known public seeds, not an untouched holdout/generalization test.Six modes: Jacobi, SGS, learned, learned with a labeled output fault on frame 9, shifted-origin Jacobi, and unsupported-origin fallback. 864 timed frames and 288 captured frames passed. The independent verifier recomputes the full operator residual, actual divergence, Courant, gauge/wall/range and integral ledgers for every captured frame, plus selection and timing ledgers for all frames. An independent NumPy transition oracle reconstructs RK2 advection, prescribed forcing, RHS, correction and tracer evolution from rest and each prior accepted capture. All 288 captures match reconstructed fields exactly on this CPU. Engineering rounding allowances are explicit; this is not a cross-platform error proof. Timed repetitions retain receipts only; complete field verification applies to separate capture replay.
Maximum learned relative L2 errors against both numerical rollouts: velocity 6.80e-8, tracer 2.43e-8, centered pressure 7.91e-8. Maximum actual divergence over the complete capture set: 8.34e-7 s⁻¹, below the 1e-5 s⁻¹ gate. The injected prediction is rejected on frame 9, numerical fallback succeeds, and learned inference resumes afterward. Every unsupported-origin frame declines before inference and matches its corresponding numerical rollout bit for bit.
Single-threaded native Rust 1.92.0 release build, AMD EPYC 9V74 cloud guest:
Rollout timing includes state/workspace initialization, advection, forcing, pressure inference/qualification/fallback, correction, tracer transport and acceptance. Model file reading/loading measured separately: 0.70 ms. CSV serialization follows the timed loop; captured replay is excluded from timing medians. OS caches are uncontrolled. No speedup threshold gates CI. These results do not establish real-time performance, long-term stability, general physics accuracy, or superiority over an analytic spectral inverse.
The separate isolated-pressure comparison also passed 36 invocations. Independent NumPy replay from the original checkpoint agrees with native pressure to relative L2 1.07e-15; independently recomputed relative residual 3.13e-9.
Validation
Commands for the current trajectory change:
cargo run --locked --release --no-default-features --example ai_pressure_trajectory -- /tmp/rheon-modal.bin .generated/ai-provider/trajectory-v1python3 tools/verify_ai_pressure_trajectory.py .generated/ai-provider/trajectory-v1RHEON_AI_TRAJECTORY="$PWD/.generated/ai-provider/trajectory-v1" python3 -m unittest discover -s tools -p test_ai_pressure_trajectory.py -v: 14 passed in normal and optimized Python.RHEON_AI_EXPORT=/tmp/rheon-modal.bin cargo test --locked --no-default-features --test solver_provider_contract -- --include-ignored: 6 passed, actual weights.cargo clippy --locked --no-default-features --all-targets -- -D warnings; desktop-feature trajectory Clippy; formatting and diff checks: passed.Adversarial coverage rejects coherent frame/receipt duplication, jointly zero timings, zero process/model timers, impossible timed residuals, and underreported positive process time. Active stages must be positive; complete process time contains model loading and all rollouts. Residual L2 is bounded by predicted divergence through the discrete norm inequality. Receipt consistency is not an external clock attestation. Validation worker’s exact four-probe script passes against preserved original captures.
Implementation validation also passed full core/default suites (329 / 336 tests, with the real-artifact test separately enabled), parallel/desktop pressure/provider suites (16 each), Python artifact tests (7, normal and optimized), repository hygiene (6), and strict Clippy for all four feature modes. The dedicated hosted workflow retrieves the immutable model and runs both invocation and complete-trajectory qualification, including corruption/incomplete-output/fallback/timing rejection tests.
Exact head
89997c5b9bb121c96f1fe40a7b050c130cc525b7: hosted real-checkpoint/full-trajectory qualification passed, including all 14 normal/optimized rejection tests. All three reconstructed field errors were zero on the hosted CPU as well. Executable, metadata, rational-contract, core-and-executable and all default/core/desktop feature suites passed on this exact head. The only failed check is the pre-existing research-book build described below; deployment was skipped. The research-book build has a confirmed pre-existingchanged qualified native source Cargo.lockfailure on base main and this exact PR head. This PR does not change that lockfile or the historical book qualification policy.GPU, ARM/WASM, other model versions, longer/different scenes, free surfaces, viscosity, obstacles, moving boundaries and desktop interaction remain unqualified. See
docs/implementation/ai-provider/README.mdfor reproduction, ownership and artifact authentication limits. Keep this PR in draft for API-owner integration review; no merge or deployment requested.