fix: emergency dump one full-hierarchy step, not per-level - #1276
fix: emergency dump one full-hierarchy step, not per-level#1276igirault wants to merge 1 commit into
Conversation
handle_dictionary_exception looped dump_level(ilvl) per level. Each dump_level bumps VTKHDF /Steps/NSteps and appends Values once while writing only that level's data. VTKHDF OverlappingAMR requires one step to hold all levels, so multi-level emergency dumps produced split, partial steps that ParaView renders as blank (single-level/no-AMR runs survived because dump_level(0) is effectively a full snapshot). dump_level also skipped compute(), leaving B=B1+B0/P/V/Etot stale. Add IDiagnosticsManager::dump_all(timeStamp): compute() every diagnostic then one full-hierarchy dump() -> a single consistent step with all levels. Emergency handler calls dump_all instead of the per-level loop. Fixes PHAREHUB#1275 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe diagnostics API adds an unconditional full-hierarchy dump operation. The concrete manager gathers all diagnostics into one writer call, and simulator emergency handling uses it instead of dumping each AMR level separately. ChangesEmergency dump flow
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Simulator
participant DiagnosticsManager
participant DiagnosticWriter
Simulator->>DiagnosticsManager: dump_all(currentTime_)
DiagnosticsManager->>DiagnosticsManager: recompute derived quantities
DiagnosticsManager->>DiagnosticWriter: dump all active diagnostics
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/simulator/simulator.hpp (1)
591-595: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy liftAdd a regression test for the emergency-dump contract.
Exercise a hierarchy with at least three AMR levels and assert that the emergency path performs exactly one full-hierarchy
dump(...)after recomputing all diagnostics. This directly protects issue#1275from regressing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/simulator/simulator.hpp` around lines 591 - 595, Add a regression test for the emergency-dump path around the simulator code invoking dMan->dump_all(currentTime_). Build a hierarchy with at least three AMR levels, trigger the emergency snapshot, and assert diagnostics are recomputed before exactly one full-hierarchy dump occurs, rather than one dump per level. Use the existing dump and diagnostics test hooks or mocks to verify the call count and ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/simulator/simulator.hpp`:
- Around line 591-595: Add a regression test for the emergency-dump path around
the simulator code invoking dMan->dump_all(currentTime_). Build a hierarchy with
at least three AMR levels, trigger the emergency snapshot, and assert
diagnostics are recomputed before exactly one full-hierarchy dump occurs, rather
than one dump per level. Use the existing dump and diagnostics test hooks or
mocks to verify the call count and ordering.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8526c185-97fc-4f39-9345-737570da0ccd
📒 Files selected for processing (3)
src/diagnostic/diagnostic_manager.hppsrc/diagnostic/diagnostics.hppsrc/simulator/simulator.hpp
Fix by claude for #1275. Here his explanation:
Summary
handle_dictionary_exception) loopeddump_level(ilvl)per AMR level. Eachdump_levelcall bumps VTKHDF's/Steps/NStepsand appends aValuesentry once while writing only that level's data — VTKHDFOverlappingAMRrequires one step to hold all levels, so a multi-level emergency dump produced split, partial steps that ParaView renders as blank. Single-level/no-AMR runs happened to survive sincedump_level(0)is effectively a full snapshot in that case.dump_levelalso skippedcompute(), leaving derived quantities (P,V) stale in the emergency snapshot.IDiagnosticsManager::dump_all(timeStamp): runscompute()on every diagnostic, then a single full-hierarchydump()— one consistent VTKHDF step with all levels. The emergency handler now callsdump_allinstead of the per-level loop.Test plan
🤖 Generated with Claude Code