Summary
The web frontend (APTG/dedx_web) carries ~810 LOC of C in wasm/dedx_extra.c that sits on top of libdedx because the upstream public API does not yet expose what a GUI needs. This tracking issue coordinates moving that proven code upstream so libdedx gains a GUI-friendly API, downstream duplication is removed, and the WASM build links a clean vendored libdedx with no local C patches.
Full design: docs/12-libdedx-migration-plan.md in dedx_web (per-symbol inventory + phased plan).
Why this matters
- Duplication / drift — the material display-name table exists twice (C
dedx_get_material_friendly_name and TS src/lib/config/material-names.ts, 151 entries each).
- A bug fix stranded downstream —
dedx_extra.c contains a corrected inverse-stopping-power branch selection that works around a real bug in upstream dedx_get_inverse_stp(); every other consumer (CLI, Python, openshieldhit) still hits the original bug.
- Re-exported internals — four accessors just publish
dedx_internal_* functions that already exist in libdedx but lack a public header entry.
Relationship to existing issues
This is the C-API-surface counterpart to the ecosystem work in the health review #108 (which calls for the Python binding to expose inverse/custom-compound functionality, and lists the GUI query API). It does not duplicate:
Phases (each a self-contained, independently releasable PR)
Suggested order: A (#119) and F (#79) first (smallest, unblock the GUI), then C (#121, highest physics value), then B (#120), then D (#122) → E (#123).
Filed via Claude Code as part of the dedx_extra.c → libdedx migration plan.
Summary
The web frontend (APTG/dedx_web) carries ~810 LOC of C in
wasm/dedx_extra.cthat sits on top of libdedx because the upstream public API does not yet expose what a GUI needs. This tracking issue coordinates moving that proven code upstream so libdedx gains a GUI-friendly API, downstream duplication is removed, and the WASM build links a clean vendored libdedx with no local C patches.Full design:
docs/12-libdedx-migration-plan.mdin dedx_web (per-symbol inventory + phased plan).Why this matters
dedx_get_material_friendly_nameand TSsrc/lib/config/material-names.ts, 151 entries each).dedx_extra.ccontains a corrected inverse-stopping-power branch selection that works around a real bug in upstreamdedx_get_inverse_stp(); every other consumer (CLI, Python, openshieldhit) still hits the original bug.dedx_internal_*functions that already exist in libdedx but lack a public header entry.Relationship to existing issues
This is the C-API-surface counterpart to the ecosystem work in the health review #108 (which calls for the Python binding to expose inverse/custom-compound functionality, and lists the GUI query API). It does not duplicate:
MeV cm²/g/MeV/nucl/g/cm²consistently.Phases (each a self-contained, independently releasable PR)
dedx_get_material_display_name()+ make C the single source of truth for display namesdedx_get_inverse_stp()branch selection for monotone curves + add a Bragg-peak STP tool (bug)dedx_wrappers.hSuggested order: A (#119) and F (#79) first (smallest, unblock the GUI), then C (#121, highest physics value), then B (#120), then D (#122) → E (#123).
Filed via Claude Code as part of the
dedx_extra.c→ libdedx migration plan.