Use `int64_t` instead of `long` in `synapses_create_generator.cpp` (fixes #1899) #1905
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 206 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.319
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1905"
general
weight: 0.35
mstimberg
Fixes #1899.
The C++ standalone template for synapse creation declared the iteration variables as
long. On macOS,int64_tislong long, so_higher_typehas no specialisation forlong, and%or//onjorkinSynapses.connectfailed to compile (no matching function for call to '_brian_mod'). As suggested in the issue, this replaces everylonginsynapses_create_generator.cppwithint64_t. On Linux, whereint64_tislong, the generated code is unchanged.Tests
New cases in the existing
test_synapse_generator_deterministicandtest_synapse_generator_deterministic_over_postsynaptic:k % 2 == 0andk // 4 == i // 4(and thejversions when iterating over the presynaptic side)(i + j) % 3 != 0andj // 4 == i // 4Each result is compared with the expected connectivity matrix computed with numpy.
On macOS (arm64, Apple clang 21.0.0, Python 3.13):
cpp_standalonewithno matching function for call to '_brian_mod'/'_brian_floordiv'.numpy,cythonandcpp_standalone.cpp_standalonetest suite, including long tests (brian2.test([], test_standalone="cpp_standalone", long_tests=True)): 270 passed, 2 skipped, no failures. This includestest_synapse_generator_deterministic_2, which also uses this template.cpp_standalonetests matchingsynapsewithfloat_dtype=float32: 72 passed, no failures.ruff format --check(v0.14.2) reports no changes.I haven't tested on Windows or Linux locally, so I'm relying on CI for those.