Skip to content

Runtime Support

RAMAL-EBX has a small SDL/GPU/ImGui runtime for an industrial EB/X-ray workbench built around PHITS. Runtime code supports authoring, simulation control, Result inspection, and Project data workflows.

Application runtime

  • main.odin owns normal SDL/GPU startup and the editor frame loop.
  • app_state.odin owns application state shape and lifecycle only.
  • app_runtime.odin owns frame polling, task polling, UI dispatch, and frame rendering.
  • app_project.odin owns staged Project open/close and Project-state swapping.
  • input_state.odin and camera.odin own fixed editor input and camera state.
  • editor_viewport_overlays.odin projects scientific labels into ImGui draw lists; the scene renderer does not maintain a second text pipeline.
  • shader_dev.odin checks development shader freshness; compiled shaders remain the renderer inputs.
  • imgui_layer.odin owns ImGui integration.

Scientific rendering

  • renderer.odin owns the GPU scene renderer and render passes.
  • renderer_cells.odin owns cell-model assembly.
  • renderer_preview.odin owns generated preview mesh preparation and upload data.
  • csg_mesh.odin generates inspection meshes from PHITS cell expressions.
  • gpu_resources.odin owns GPU resources; render_math.odin owns render math; debug_draw.odin owns debug lines and drawing helpers.
  • editor_viewport_interaction.odin and editor_viewport_overlays.odin own editor interaction and scientific overlays.
  • editor_geometry.odin owns the shared cached cell queries used by viewport, validation, and rendering flows.
  • dose_field.odin owns loaded Result dose/uncertainty fields.

The renderer visualizes Scene_State and Result fields. It does not own PHITS meaning, Case identity, or scientific verification. ImGui is composed as the final UI pass with the current integration rule documented in IMGUI_SDLGPU3_INTEGRATION.md.

Process boundary

Simulation is a transient Odin state service. process.odin owns process-group control; simulation.odin starts and polls the strict Case runner; and study_run.odin sequences ordinary Jobs. ml_task.odin starts and polls one Python ML command. These are services/state, not persistent Simulation, Study Run, or ML records.

Deliberate scope

The active runtime has no app-level asset registry, imported model conversion workflow, audio subsystem, or generic game scene model. Text is a small renderer/editor service for labels and overlays. New runtime code belongs only when it supports PHITS authoring, execution, completed Result inspection, or the Project/Research records.