Skip to content

Fix #1275 accessing egs_glib geometries by ausgab objects - #1405

Open
mchamberland wants to merge 3 commits into
nrc-cnrc:developfrom
mchamberland:fix-egs-glib-ausgab
Open

Fix #1275 accessing egs_glib geometries by ausgab objects#1405
mchamberland wants to merge 3 commits into
nrc-cnrc:developfrom
mchamberland:fix-egs-glib-ausgab

Conversation

@mchamberland

Copy link
Copy Markdown
Contributor

Summary

  • Fixes #1275 by making egs_glib geometries discoverable by both names:
    • the outer wrapper name (existing behavior)
    • the internal included simulation geometry name (new alias behavior)
  • Keeps lookup deterministic and backward compatible by preserving primary-name precedence and adding alias collision warnings.
  • Adds a focused regression suite (positive + negative + label-based cases) under HEN_HOUSE/egs++/geometry/examples, plus a helper script:
    • run_glib_alias_tests.sh

What changed

  • Geometry registry
    • Added alias storage and lookup support in EGS_BaseGeometry internals.
    • Added EGS_BaseGeometry::addGeometryAlias(...).
    • Clears/removes aliases with the geometry lifecycle.
  • egs_glib
    • Captures the included geometry name before the wrapper rename.
    • Registers the original name as an alias after the rename.
    • Warns if alias registration fails (e.g. collision).
  • Tests
    • Added egs_glib include examples and egs_app inputs for:
      • internal-name success
      • wrapper-name success
      • both names in one input (glib_alias_pos_both)
      • missing geometry (expected failure)
      • alias collision (expected failure)
      • region-label usage (glib_alias_labels_pos)
      • unknown dose-region label with glib + alias lookup (glib_alias_labels_neg_unknown_label; still completes successfully given current fallback behavior)

Validation

  • Ran the full matrix via HEN_HOUSE/egs++/geometry/examples/run_glib_alias_tests.sh:
    • PASS expected: internal / wrapper / both / label tests / unknown-label probe
    • FAIL expected: missing geometry and alias collision tests
  • Confirmed non-zero scoring in generated 3ddose outputs for the positive cases checked.
  • Performance sanity check: no measurable runtime difference between wrapper-name and alias-name lookup paths in repeated egs_app runs.

Preserve egs_glib wrapper naming while registering the included
simulation geometry name as an alias for lookup by ausgab objects.

Made-with: Cursor
Add egs_glib include geometries and egs_app test inputs that cover
internal and wrapper name lookups, label-based region selection,
and expected failure paths, plus a runnable test matrix script.

Made-with: Cursor
- Replace hardcoded APP_BIN/LIB_DIR with HEN_HOUSE, EGS_CONFIG/EGS_MACHINE,
  EGS_HOME-derived defaults, and documented env overrides.
- Symlink glib_alias *.egsinp and *.geom into $EGS_HOME/egs_app because
  egs_app resolves -i only under that directory.
- Add glib_alias_labels_neg_unknown_label.egsinp under geometry/examples with
  relative include path for the matrix.

Made-with: Cursor
@mchamberland
mchamberland requested a review from a team as a code owner May 5, 2026 03:06
@ftessier ftessier added this to the Release 2027 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants