fortranspire.agent.translation_graph_phase1ΒΆ

LangGraph wiring for Phase 1 β€” Fortran β†’ OpenACC GPU + Cython.

This module used to hold all six pipeline nodes inline (~1400 lines, hard to test, hard to extend). Now it’s just the graph definition; each node lives in its own module under fortranspire.agent.nodes.

Pipeline (sequential, no branching):

init β†’ parser β†’ extractor β†’ pure_elemental β†’ openacc β†’ cython_wrapper

β†’ equivalence_harness β†’ validation β†’ END

LLM call budget (4 maximum):

  • extractor β€” 1 call (reasoning)

  • openacc β€” 1 call (reasoning)

  • cython_wrapper β€” 2 calls (code)

The other three nodes (init, parser, pure_elemental, validation) are deterministic and never touch an LLM.

Compilation targets validated by validation:

  • gfortran -fsyntax-only (CPU flavour, stripped of !$acc directives)

  • gfortran -fopenacc -fsyntax-only (CPU flavour with directives)

  • nvfortran -acc -gpu=cc80 -fsyntax-only (GPU flavour, A100)