Skip to content

Location manager: abort on per-PE element id overflow, note unpacked-index arrays, add unbounded_migration test - #4016

Open
lvkale wants to merge 2 commits into
reviewed-with-reconversefrom
objid-pr0-diagnostics
Open

lvkale wants to merge 2 commits into
reviewed-with-reconversefrom
objid-pr0-diagnostics

Conversation

@lvkale

@lvkale lvkale commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

PR 0 of the object id work in #3994 (design: #4015, doc/objid64-design.md section 9). Diagnostics and a test only; no change to how ids are formed or how messages are delivered, so it can merge ahead of the redesign.

Abort on per-PE element id overflow. An array without an index compressor mints ids from a per-PE counter in the 16-bit element field, and nothing checked it: past 65,535 elements on one PE the counter carried into the home field, ids collided with another PE's, and home lookups went to the wrong PE silently. CkLocMgr::getNewObjectID now aborts at the limit with the location manager and the remedies. Verified: 65,535 inserts on one PE succeed, 65,536 abort with the full message (kept under 255 characters because reconverse's CmiAbort formats into a 256-byte buffer).

Note when an array's index is not packed into ids. Printed once on PE 0 by the CkLocMgr constructor when there is no compressor, in two wordings: bounds that need more bits than CMK_OBJID_ELEMENT_BITS (reports the count needed), or an array given setNumInitial/setEnd but no bounds (points at setBounds). The sized CkArrayOptions constructors set bounds, so ordinary arrays print nothing; an array with neither size nor bounds is deliberately dynamic and prints nothing either. New public FixedArrayIndexCompressor::bitsNeeded(bounds), also used by make().

New test tests/charm++/unbounded_migration. Every migrating test in the tree uses a small bounded array, so the counter-plus-map id scheme was never exercised with migration. This one creates a 2D array with no bounds, inserts all elements dynamically, and migrates each element to the next PE every five steps under a message ring; ends by quiescence. Registered in the regular list (note anytime_migration sits in FTDIRS and only runs under syncfttest).

Tested on reconverse-darwin-arm8 (production build): the new test on 2 and 4 PEs, 5 repeated runs, and through make test; pingpong, hello/4darray and startupTest print no note; probes for both note wordings and for the abort at the exact boundary.

🤖 Generated with Claude Code

lvkale and others added 2 commits September 29, 2026 18:48
…rray's index is not packed into ids

An array with no index compressor mints element ids from a per-PE counter in
the element field (16 bits by default). Nothing checked the counter: past
65,535 elements on one PE it carried into the home field, so ids silently
collided with another PE's and every home lookup for them went to the wrong
PE. getNewObjectID now aborts at the limit, naming the location manager and
the remedies (insert from more PEs, setBounds, fewer collection bits). The
message is kept under 255 characters because reconverse's CmiAbort formats
into a 256-byte buffer.

Whether an array gets a compressor is easy to get wrong by accident: the
sized CkArrayOptions constructors set bounds, but setNumInitial/setEnd do
not, and bounds that need more than CMK_OBJID_ELEMENT_BITS are refused
silently. The CkLocMgr constructor now prints one note on PE 0 in either
case, with the bit count it needed or the setBounds remedy. A public
FixedArrayIndexCompressor::bitsNeeded(bounds) reports the width; make()
uses it too.

Diagnostics only; no change to ids or delivery. Part of the object id work
tracked in #3994 (PR 0 of doc/objid64-design.md on the objid-redesign
branch).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… index is not packed into ids

Every migrating test in the tree uses a small bounded array, whose index is
compressed into the element id, so the other id scheme (per-PE counter plus
an index<->id map in CkLocMgr) was never exercised together with migration.
This test creates a 2D array with no bounds and no initial size, inserts
every element dynamically from PE 0, and runs a message ring in which each
element migrates to the next PE every five steps; it ends by quiescence.
Default 4x3 elements, count 40; arguments nX nY count.

Registered in the regular test list (anytime_migration is in FTDIRS and
only runs under syncfttest).

Part of the object id work tracked in #3994.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant