Skip to content

more agressive pruning of diagram without flavor#33

Open
oliviermattelaer wants to merge 4 commits into
mainfrom
more_trimming
Open

more agressive pruning of diagram without flavor#33
oliviermattelaer wants to merge 4 commits into
mainfrom
more_trimming

Conversation

@oliviermattelaer

Copy link
Copy Markdown
Contributor

run the trimming

  1. before color computation now
  2. in all cases.
    By default this also remove diagram only possible for symmetric flavor that the one considered.
    the standalone --mask=False does not trim those last one for a simplify debugging/check

@theoheimel theoheimel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the two processes from #13 (comment) and both run now and the cross section in MG7 appears to be correct. So from my side, we can merge this

@oliviermattelaer

oliviermattelaer commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

I would say that i would like to check the following:

  • why the build wheels is suddently crashing (but maybe we do not care --your call--)
  • MG7 Hall of Shame #13 (comment) might be created by this patch, so I will need to investigate this (first crash is fixed and does not seem related but another related one surfaced later, and I did not had the time to fix it yet)

@theoheimel

Copy link
Copy Markdown
Contributor

The build wheel issue was unrelated and I fixed it in main

@oliviermattelaer

oliviermattelaer commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

update on the status for w+ _anti_neutrino > z ta+

  • run does generate/output
  • check language is consistent
Language comparison results (Fortran SA / C++ SA / MG7 SA / Python):
Process          Fortran SA      C++ SA          Python          max rel.diff.   Result
w+ vt~ > z ta+   2.045462e-01    0.000000e+00    0.000000e+00    1.000000e+00    Failed
  • check is working:
Lorentz invariance results:
Process          Min element       Max element       Relative diff.    Result
Summary: 0/0 passed, 0/0 failed
Not checked processes: w+ Nx > z ta+
Flavor grouping check results:
Process          Merged            Unmerged          Relative diff.    Result
w+ vt~ > z ta+   0.0000000000e+00  3.7927733170e-01  1.0000000000e+00  Failed
Summary: 0/1 passed, 1/1 failed
Failed processes: w+ vt~ > z ta+
Gauge results (switching between Unitary/Feynman gauge):
Process          Unitary           Feynman           Relative diff.    Result
Summary: 0/0 passed, 0/0 failed
Process permutation results:
Process          Min element       Max element       Relative diff.    Result
w+ Nx > z ta+    0.0000000000e+00  0.0000000000e+00  0.0000000000e+00  Passed

Note "manual" check of merged/unmerged (with fortran output) are consistent .... So the issue is not fortran related but purely C++ and Python that does return zero

oliviermattelaer and others added 2 commits July 13, 2026 20:13
FLV coupling definition (single source of truth):
- add base_objects.FLV_Coupling.get_partner_indices() and route the
  Fortran, C++, mg7 and Python backends through it, fixing the transposed
  PARTNER/PARTNER2/VAL table for a single merged leg not in the first
  position (e.g. the merged neutrino of w+ ta+ vt~)
- process_checks: pass the flavor group position (not the PDG) and index 1
  (not -1) for unmerged legs to smatrix, matching the standalone FLAV_TABLE
- mg7: null-initialise FLV_COUPLING::value[] so the cIPF_value setup does
  not dereference uninitialised pointers (segfault on single-entry couplings)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The MGONGPU_HARDCODE_PARAM cIPF_value initializer read every value[]
slot unconditionally (and via `.real()` on a cxtype* pointer). Flavor
slots with no coupling are null (FLV_COUPLING constructor), so guard
each read as `value[i] ? value[i]->real() : 0`, matching the runtime
(non-hardcoded) path and fixing both the null dereference and the
pointer access.

mg7: fix out-of-bounds flavor index in the runtime flavor table (segfault)

The per-flavor tFlavors table (used at runtime to index the FLV_COUPLING
partner1/partner2/value arrays, size max_flavor) was built with a naive
f-1: for a merged leg flavors[0] holds the constituent PDG, so a merged
neutrino gave index 16-1=15, well out of range -> out-of-bounds read and
segfault. Convert a merged leg's PDG to its 0-based position inside the
merged group instead (unmerged legs map to 0). This only surfaced for
merged leptons/neutrinos; light quarks worked because PDG 1..4 equals the
position. Matches the standalone_cpp flavor_table, which was already correct.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@oliviermattelaer

oliviermattelaer commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

update on the status for w+ _anti_neutrino > z ta+

  • run does generate/output
  • check language is consistent
Language comparison results (Fortran SA / C++ SA / MG7 SA / Python):
Process          Fortran SA      C++ SA          MG7 SA (cppnone)MG7 SA (cppsse4)Python          max rel.diff.   Result
w+ vt~ > z ta+   2.045462e-01    2.045462e-01    2.045462e-01    2.045462e-01    2.045462e-01    2.156695e-08    Passed
Summary: 1/1 passed, 0/1 failed
  • check is working:
Lorentz invariance results:
Process          Min element       Max element       Relative diff.    Result
Summary: 0/0 passed, 0/0 failed
Not checked processes: w+ Nx > z ta+
Flavor grouping check results:
Process          Merged            Unmerged          Relative diff.    Result
w+ vt~ > z ta+   2.3615583289e+01  2.3615583289e+01  0.0000000000e+00  Passed
Summary: 1/1 passed, 0/1 failed
Gauge results (switching between Unitary/Feynman gauge):
Process          Unitary           Feynman           Relative diff.    Result
Summary: 0/0 passed, 0/0 failed
Process permutation results:
Process          Min element       Max element       Relative diff.    Result
w+ Nx > z ta+    0.0000000000e+00  0.0000000000e+00  0.0000000000e+00  Passed
Summary: 1/1 passed, 0/1 failed

@Qubitol, check carefully the list commit since it change some deep stuff for the madmatrix side (which was creating some segfault for this process)

@oliviermattelaer
oliviermattelaer requested a review from Qubitol July 14, 2026 06:47
@oliviermattelaer oliviermattelaer mentioned this pull request 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