Conversation
EngineId::operator< compared instance names only when both ids had one,
so "g4" and "g4.x" were equivalent keys in knownSeeds_. A module calling
getSeed() and getSeed("x") received the same seed for both engines, and
getSeed returned the cached value before ensureUnique could throw. Mixing
the two forms also broke the strict weak ordering std::map requires, so
which entry was reused depended on call order.
Compare (moduleLabel, instanceDefined, instanceName) as a tuple in both
operator< and operator==. Seeds are still assigned in call order, so a
module using only one form gets exactly the seeds it got before.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgCD6rzgTteUFTPsdvWcou
Collaborator
|
☀️ The build tests passed at e304eab.
N.B. These results were obtained from a build of this Pull Request at e304eab after being merged into the base branch at 329c100. For more information, please check the job page here. |
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.
What
SeedServiceHelper::EngineIdnow compares(moduleLabel, instanceDefined, instanceName)as a tuple in bothoperator<andoperator==.Why
EngineId::operator<compared instance names only when both ids had one, so an id without an instance name (g4) was an equivalent key to every id of the same module with one (g4.x,g4.y) inknownSeeds_.SeedService::getSeedreturns the cached seed when the insert finds an equivalent key, beforeensureUniqueruns. As a result:getSeed()followed bygetSeed("x")in one module returned the same seed for both engines. The header promises an exception when two engines share a seed.std::maprequires (g4 ~ g4.xandg4 ~ g4.y, butg4.x < g4.y), so which entry got reused depended on call order.A standalone program reproduces this, replaying
getSeed's insert-or-return logic against the real header. Seeds are shown as base + offset, with base 100:getSeed(),getSeed("x")getSeed("x"),getSeed("y"),getSeed()getSeed("y"),getSeed(),getSeed("x")gen,g4,mix.a,mix.b,gen(one form per module)Impact on existing jobs
None expected. Seeds are assigned in call order (
currentSeed_++), not map order, and no Offline module other thanSeedTest01passes an instance name. Every module that uses a single form gets exactly the seeds it got before; only the mixed case changes.Validation
g++ -std=c++20 -Wall -Wextra -Werror -fsyntax-onlyonSeedService.cc,SeedService_service.ccandSeedTest01_module.ccin the muse al9 prof environment: clean.SeedService/test/*.fcljobs. None of them mixes the two forms within one module.Deliberately not in this PR
These came up in the same review of
SeedService:ensureRangechecks only the upper bound, so a negativepreDefinedOffsetis accepted, andbaseSeed > 0is never validated. This will be a separate PR.automaticSeedsusesautoIncrementwhile the job tools setbaseSeed = 1 + index. Seeds are unique within a job, but neighbouring jobs share seed values between different modules.linearMappingwould keep the job ranges disjoint.🤖 Generated with Claude Code
https://claude.ai/code/session_01PgCD6rzgTteUFTPsdvWcou