Skip to content

Dependency-boundary shim library (ObjexxFCL Array, Constant::*, libm intrinsics) #66

Description

@Tokarzewski

Part of #64.

Problem

Most compile-closure failures are not the function itself — they are unported types/symbols it references. Porting each fully is wasteful; a thin shim satisfies the compiler and is written once, reused everywhere.

Shims to build/extend

  • ObjexxFCL Array1D/Array2D → List-backed 1-based arrays in ep_prelude.mojo, mirrored by std::vector-backed structs in ep_oracle.h (C++ keeps a(i)/a(i,j) call syntax, Mojo uses []; both 1-based). ✅ landed main 61db4bf
  • Constant::* → extended (added Sigma, UniversalGasConstant, Gravity); kept Mojo/C++ values identical. ✅
  • libm → verified empirically: sin links under -Xlinker -ldl (no -lm) — trig links as intrinsic (myth busted; matches the libm-link finding). ✅
  • Psychrometric / table lookups behind a shim interface. ⏳ only the pvstar stub exists; real psychro shims still TODO — keep open.

Done when

  • A shimmed dependency compiles a dependent fn without a full port.
  • The shim layer in scripts/sft/diff_verify_ep.py consumes these uniformly (and its dead energyplus-mojo/.pixi Mojo path is fixed → MOJO_HOME-overridable, live NuMojo default).
  • Each shim verified vs C++ once: an Array1D + Constant.Sigma + sin function compiles + numerically matches C++ through diff_verify_ep.py (1/1). Existing items unaffected (9/10 spot-check; the 1 fail is a pre-existing std::cout-without-<iostream> harness gap).

Remaining: psychrometric shims. Otherwise the dependency-boundary shim library is in place.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions