Skip to content

[issue-862] Move from vector of call structs in 911 simulations to separate vectors - #953

Open
stiber wants to merge 3 commits into
StiberDevelopmentfrom
issue-862-sperate-call-struts-vector-in-911-simulations
Open

[issue-862] Move from vector of call structs in 911 simulations to separate vectors#953
stiber wants to merge 3 commits into
StiberDevelopmentfrom
issue-862-sperate-call-struts-vector-in-911-simulations

Conversation

@stiber

@stiber stiber commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Closes #862

Description

This was originally PR #946 ; moving this to merge into StiberDevelopment rather than SharedDevelopment. The goal is to refactor the NG911 data structures to match the "struct of arrays" approach of Graphitti that makes CPU code parallel to GPU code.

Checklist (Mandatory for new features)

  • Added Documentation
  • Added Unit Tests

Testing (Mandatory for all changes)

  • GPU Test: test-medium-connected.xml Passed
  • GPU Test: test-large-long.xml Passed

@stiber stiber self-assigned this Aug 21, 2026
@stiber stiber added refactor doesn't change functionality, just improves code NG911 labels Aug 21, 2026
@stiber

stiber commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Here are some comments from Gemini; I need to look through this code and run tests on the INL research machines to evaluate these changes:


Based on code analysis of branch issue-862-sperate-call-struts-vector-in-911-simulations (PR #946) against SharedDevelopment, the following conclusions can be drawn regarding the test failures:


1. Purpose of PR #946

The branch refactors NG911 call storage from arrays of Call structs into Struct-of-Arrays (SoA) field vectors:

  • Introduces Simulator/Utils/CallCircularBuffer.h (waiting queues).
  • Introduces Simulator/Utils/CallSlotArrays.h (active server slots).
  • Introduces Simulator/Utils/CallUtils.h (conversions and helpers).
  • Updates Simulator/Vertices/NG911/All911Vertices.cpp, Simulator/Edges/NG911/All911Edges.cpp, and GPU counterparts.
  • Adds unit tests in Testing/UnitTesting/InputManagerTests.cpp.

2. Primary Cause of Regression Test Failure: test-small-911

In Simulator/Vertices/NG911/All911Vertices.cpp, commit 7ad0f51f corrected a calculation bug in responder countdown:

On SharedDevelopment:

double driveTime = (dist2incident / avgDrivingSpeed_) * 3600;
serverCountdown_[vertexIdx][availUnit] = driveTime + incident.onSiteTime;
serverCountdown_[vertexIdx][availUnit] = incident.duration; // Overwrote countdown

On SharedDevelopment, line 574 set serverCountdown_ = driveTime + onSiteTime, but line 576 immediately overwrote it with incident.duration.

On issue-862-sperate-call-struts-vector-in-911-simulations:

serverCountdown_[vertexIdx][availUnit]
   = static_cast<int>(driveTime) + vertexQueue.onSiteTime()[queueEnd];

The overwrite was removed, fixing the countdown logic to properly reflect driving time plus on-site time.

Consequence for Regression Tests

The reference benchmark file Testing/RegressionTesting/GoodOutput/Cpu/test-small-911-out.xml was generated with the older uncorrected countdown behavior. Because the simulation timeline changes with the corrected countdown:

  1. ./cgraphitti -c .../test-small-911.xml produces output matrices reflecting the corrected timeline.
  2. compare_matrices detects numerical/event differences against the old GoodOutput/Cpu/test-small-911-out.xml.
  3. compare_matrices exits with a non-zero status, failing the regression test suite.

3. Unit Test Status

The unit test binary (make tests && ./tests) includes the new test suite TEST_F(InputManagerFixture, getEpochEventsCallCircularBuffer). The unit test logic matches the CallCircularBuffer implementation and is expected to pass independently.


4. Summary & Resolution Plan

  • Unit Tests: Pass without issues.
  • Non-911 Regression Tests (9 suites): Untouched by these changes and expected to pass.
  • 911 Regression Test (test-small-911): Fails strictly because the bug fix alters simulation output relative to the outdated GoodOutput reference.
  • Resolution: Once verified on Linux, test-small-911-out.xml under Testing/RegressionTesting/GoodOutput/Cpu/ must be regenerated to establish the new reference output for NG911 simulations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NG911 refactor doesn't change functionality, just improves code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant