Repository navigation
mcstas-comps: inventory cleanup and test coverage - #3219
Merged
Merged
Conversation
Not used by any example. FermiChopper and FermiChopper_ILL remain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No example uses them. The sasmodels SasView_* components replace SasView_model, so share/sasview_proxy.c goes too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitess, MCNP and Tripoli4 readers/writers go, with vitess-lib and the neutronics library. Virtual_input/Virtual_output stay in obsolete but stop with an error. Examples and manuals point to MCPL_input/MCPL_output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gives Mask a test instrument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Default EF=5: with EI=EF=EN=0 the angle branch gave EI=inf and the HKL calculator failed. psd_detector is unchanged for the documented examples; only the post-analyser E_monitors now get a real range. Example: -> %Test: with the reference refreshed (220.701). The slow Pb(200) scan stays disabled as TestScan:. Error exit uses exit(-1), and commented-out Virtual_* blocks use MCPL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are set in INITIALIZE and read in TRACE, but were never updated on the device. Changes GPU results; CPU is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Hand-held GPU run of RITA-II model (slow workstation-GPU) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dd test Reflect through StdReflecFunc so R0 applies only on reflections and m<1 is handled; reflectivity files now scale the weight. Changes results for R0<1. Test_Guide_four_side compares with Guide and Elliptic_guide_gravity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default empty filename skipped the grid, so nothing was transmitted. An even hole count re-tested a stale column and propagated twice. Bounds now default to 0 so xwidth/yheight work alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neutrons were absorbed whenever the outer wall cylinder was left through top or bottom, even past the channel exit. Changes results with vertical divergence. Test_Pol_bender_tapering compares with Pol_bender. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ocs and test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on misses, fix 2theta binning; add Test_Monitors_cyl Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At large radius, rounding in the cylinder intersection exceeded the fixed 1e-10 m threshold, so a wall just reflected on was hit again at the same point, costing an extra reflectivity factor each time (9% low at R=1e5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Almost full coverage in McStas. May add the 2 SANS-comps and the optimiser-pair.. |
…ures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s_Abs SANS_Liposomes_Abs used an uninitialised inner radius in INITIALIZE. Enable both comps in SANSsimple and Test_SANS (mock sphere curve). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same fix as Pol_bender. No change seen in Test_Vertical_Bender. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TOF2Q_cyl_monitor: lambda unset for pixel other than 0/1. Pol_bender_tapering: no propagation by unset time on entry miss. FermiChopper: initialise c in FC_xzbrent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add acc routine and pass _particle for the RNG, as in Lens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cdoc HTML An unspaced "<x" was read as an HTML tag and cut the description short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcdoc HTML read <parameters=values> as a tag and dropped it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t_shellguides Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
willend
marked this pull request as ready for review
November 29, 2026 19:48
This was referenced Nov 29, 2026
…str] units <...> placeholders were swallowed as HTML tags by mcdoc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
The failling test https://github.com/mccode-dev/McCode/actions/runs/46305431939/job/141480284593?pr=3219 hangs on a quite specific case of a 1-element vector vector = {val} init that mccode-antlr choked on - upstream PR contributed. Everything else is green and a IMHO constitutes a long-overdue cleanup. Merge! |
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Free-form text area
First step of a McStas component cleanup toward better test coverage: remove dead event-file components, fix bugs found while adding cross-check tests.
Removed
vitess-lib, theneutronicslibrary andENABLE_NEUTRONICS.Vitess_ChopperFermi(did not build in 3.x),Beam_spy,SasView_model+share/sasview_proxy.c.Vin_test,Vout_test,vinput2mcpl.Virtual_input/Virtual_outputkept inobsolete, but stop with an error pointing toMCPL_input/MCPL_output.Histogrammer: MCPL input only (MODE,bufsizeremoved).vitess_fc_*manual figures.Component fixes
Guide_four_side★: R0 applied once per reflection, m<1 handled, reflectivity files scale the weight, uninitialised wall index.multi_pipe★: hole grid never ran; even hole count propagated twice.Pol_bender_tapering★: absorbed at top/bottom past the channel exit.Sapphire_Filter★: exit aperture added.Mirror_Elliptic_Bispectral★: uninitialisedhit_back_flag; wrong sign in thetransmit=1reflection.Mirror_Curved_Bispectral★: intersections 2 and 3 used the wrong mirror height.TOF_cylPSD_monitor★: counted exits through the cylinder ends; absorbed misses despiterestore_neutron=1.TOF2Q_cylPSD_monitor★: same two fixes.TOF2Q_cyl_monitor★:restore_neutronfix; 2theta binning off by half a bin;t_chopnow really in ms (default 4).Pol_bender: at large radius, rounding made a wall just reflected on get hit again (9% low at R=1e5); distance threshold now scales with radius.Vertical_Bender: same threshold fix (no change seen inTest_Vertical_Bender).SANS_Liposomes_Abs★: uninitialised inner radius gave zero output.Source_adapt★: did not compile (multi-variable DECLARE line); under MPI, the adaption ramp assumed all rays on one process (−33% at 2 processes).PerfectCrystal: builds with OpenACC (NANfallback for nvc; GPU-callablegrandvec_target_circle).clang --analyze:TOF2Q_cyl_monitorlambdaunset forpixel∉ {0,1};Pol_bender_taperingpropagated by an unset time on entry miss;FermiChopperroot finder read an unset value. No change in tests.Source_div:exit(-1)with a visible message on zero divergence.AF_HB_1D_process★:exit(-1).Documentation
SiC★: documented from the code (Born approximation, corner origin, built-in 80 AA layer on Si; marked AI-written); MCDISPLAY added.Sapphire_Filter,Mirror_Elliptic_Bispectral,Mirror_Curved_Bispectral: docs rewritten (frame, orientation, examples).PerfectCrystal★: changelog moved from%Iinto%D.Union_abs_logger_1D_time★:%Ddescribed a height histogram; it bins absorption time.Pol_bender: reflectivity defaults described correctly.SiC,Mirror_Elliptic_Bispectral,Mirror_Curved_Bispectral: plate ranges in LaTeX math mode; a bare<xcut the mcdoc HTML description short.[parameters=values]instead of<parameters=values>, which mcdoc HTML dropped as a tag.SANSsimple(Linda Udby, NBI),Source_div(Kim Lefmann),Reflectometertypo,Test_shellguidesmailto link.New and extended tests
Test_Guide_four_side: vsGuide,Elliptic_guide_gravity.Test_multi_pipe: vs analytic open fraction.Test_Pol_bender_tapering: vsPol_bender.Test_Sapphire_filter: vsNCrystal_filter.Test_PerfectCrystal: Si(111) backscattering vs NCrystal.Test_SiC: vsMultilayer_Sample.Test_AF_HB_1D: spinon continuum, 1e5 rays via anNcountparameter.Test_Bispectral_mirrors: both Bispectral mirrors vsMirror, pencil beam.Test_Monitors_flat:EPSD_monitor,PSD_TOF_monitor,PSD_monitor_psf,TOFlog_monitor,TOF_PSD_monitor_rad,TOF_PSDmonitor,Flex_monitor_3D(all ★) vsPSD_monitor.Test_Monitors_cyl: the three cylindrical TOF monitors vsMonitor_nDbanana;Monitor_4PI★ vsMonitor_nDsphere.Test_Source_adapt:Source_adapt+Adapt_check★ vsSource_simple.Test_Source_multi_surfaces★: mock spectra vs analytic value.Test_abs_logger_1D_time:Union_abs_logger_1D_time★ vsUnion_abs_logger_1D_space_tof, plain and conditional.SANSsimple:SANS_Liposomes_Abs★ enabled asSAMPLE=2.Test_SANS:SANSCurve★ asSAMPLE=8, mock sphere curve vsSANSSpheres.Test_Pol_Bender: reference updated (0.704 → 0.655; stale before this PR).Test_Mask(Mask,Absorber★);%TestforTest_NMO(NMO★) andTest_FlatEllipse_finite_mirror.Test_Guides: cases forGuide_gravity_psd,Guide_multichannel★.RITA-II: defaults (EF=5) and%Testrestored; E_monitors get a real range;compmatrix.sh:LC_ALL=Cfor a locale-independent order.*_examples.txt,comps_no_examples.txtand the affected manual pages.Open
Source_Optimizer/Monitor_Optimizer: do not compile and are biased once fixed; left out, see Source_Optimizer / Monitor_Optimizer: do not compile, and give biased intensities #3220.#ifdef NEUTRONICScode inmccode-r.c.Declaration of use of AI-tools
Co-Authored-By.Development OS / boundary conditions
macOS arm64, clang, conda env. All new and extended tests run on CPU (1e5-1e7 rays), plus
Test_NMO,Test_FlatEllipse_finite_mirror,Histogrammerwith MCPL,SNS_ARCS,Test_Fermi,templateSasView, RITA-II. GPU: RITA-II run by hand on the GPU workflow. Not tested locally: Linux, Windows, PDF manual build.PR Checklist for contributing to McStas/McXtrace
My contribution includes patches to an existing instrument file
mcdocpage of the instrument in themcdoc-pagesartifact of thecheck-doc-paramsCI runmcrun --c-lint"linter" and followed advice to remove most / all warnings that are raised(all touched instruments linted; real issues in touched components fixed, the rest are false positives, shared runtime/library code or untouched components)
My contribution includes a new instrument file
mcdocpage of the instrument in themcdoc-pagesartifact of thecheck-doc-paramsCI run%Test:line (or a%TestScan:line for a parameter scan) to describe expected behaviourMy contribution contains something else
Tip for reviewers: Visit
https://blueblazin.github.io/blockviz/#github=[URL_of_this_PR]for a visual look at code changes🤖 Generated with Claude Code