Add typed-channel PPR C++ extraction support - #724
Draft
mkolodner-sc wants to merge 10 commits into
Draft
Conversation
mkolodner-sc
force-pushed
the
mkolodner-sc/typed-channel-ppr-cpp
branch
from
July 29, 2026 16:48
b8bca9e to
41b08d4
Compare
| // Helper function for adding one channel's extracted PPR candidates into the | ||
| // emitted typed feature table and a fill-pass candidate list. | ||
| // | ||
| // Unlike addTypedPPRChannelCandidates, this helper owns the output view: it |
Collaborator
There was a problem hiding this comment.
Does it own the output view?
Comment on lines
+565
to
+568
| if (a.channelIndex != b.channelIndex) { | ||
| return a.channelIndex < b.channelIndex; | ||
| } | ||
| return a.nodeId < b.nodeId; |
Collaborator
There was a problem hiding this comment.
btw is there a case where the same node id can be returned from the same channel index twice?
| // Typed channels are constructed from the same seed batch and graph schema; | ||
| // only the edge-type traversal allowlist differs. Use the first state as | ||
| // the shared schema source for batch size and node-type count. | ||
| const auto* firstState = states.front(); |
Collaborator
There was a problem hiding this comment.
qq we do guarantee there's always at least one state rght?
| } | ||
|
|
||
| PPRExtractResult extractedTypedPPRByNodeTypeId; | ||
| std::vector<int32_t> topUpChannelQuotas(static_cast<size_t>(numChannels), maxPPRNodes); |
Collaborator
There was a problem hiding this comment.
If these are always the same value then does this even need to be a vector?
Or as we're discussing offline maybe we should ignore this and only use the per-channel quota?
| } | ||
| } | ||
|
|
||
| if (enableResidualTopUp && selectedNodes.size() > 1) { |
Collaborator
There was a problem hiding this comment.
Sorry silly question but this code all uses the neighbor cache we have right?
|
|
||
| queueDrainResult.drainedChannelIndices.push_back(static_cast<int32_t>(channelIndex)); | ||
|
|
||
| bool fetchBudgetRemaining = maxFetchIterations < 0 || fetchIterationCounts[channelIndex] < maxFetchIterations; |
Collaborator
There was a problem hiding this comment.
should this be maxFetchIterations <= 0?
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.
Summary
Adds the C++ implementation needed by typed-channel PPR sampling.
This is the lower PR in the split stack. It builds on #723 and intentionally contains no Python sampler/API wiring.
What Changed
[best_score, channel_scores..., channel_presence_bits...].Tests
gigl-core/tests/ppr_forward_push_test.cpp.make -C gigl-core check_format_cpppasses.