Skip to content

Add typed-channel PPR C++ extraction support - #724

Merged
mkolodner-sc merged 14 commits into
mainfrom
mkolodner-sc/typed-channel-ppr-cpp
Aug 5, 2026
Merged

Add typed-channel PPR C++ extraction support#724
mkolodner-sc merged 14 commits into
mainfrom
mkolodner-sc/typed-channel-ppr-cpp

Conversation

@mkolodner-sc

@mkolodner-sc mkolodner-sc commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the C++ support needed for typed-channel PPR sampling.

This is the lower PR in the typed PPR stack. It adds the core typed-channel frontier drain and extraction logic used by the Python sampler layer in the follow-up PR.

Motivation

For heterogeneous graphs, different edge types can represent meaningfully different relation paths. Typed-channel PPR lets us run separate PPR traversals over configured edge-type channels, then merge the results into one sequence while preserving channel-aware features.

What Changed

  • Adds typed-channel frontier draining across multiple PPRForwardPush states.

    • Each channel has its own traversal allowlist.
    • Active channel frontiers are unioned before neighbor fetch so shared one-hop fetches are issued once.
  • Adds typed PPR extraction.

    • Accepts integer per-channel target counts from the caller.
    • Derives the final per-seed sequence cap from the sum of those target counts.
    • Deduplicates nodes across channels.
    • Attributes duplicate nodes to the channel where they have the strongest calibrated score.
    • Fills each channel toward its target, then globally overflows unused slots by best score.
  • Handles residual top-up in the typed path.

    • Residual candidates participate in the same channel target and overflow policy.
    • Final emitted rows use calibrated scores when residual top-up is enabled.
  • Emits typed edge attributes as:

    • [best_score, channel_scores..., channel_presence_bits...]

Tests

Added focused C++ coverage for:

  • typed frontier draining
  • fetch-budget behavior
  • typed extraction
  • cross-channel deduplication
  • residual top-up behavior
  • channel target and overflow behavior

@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-cpp branch from b8bca9e to 41b08d4 Compare July 29, 2026 16:48
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-cpp branch from a91cce7 to 006f24e Compare August 3, 2026 05:54
Base automatically changed from mkolodner-sc/ppr-selector-helper to main August 4, 2026 06:06
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp
Comment thread gigl-core/core/sampling/ppr_forward_push.h
Comment thread gigl-core/core/sampling/ppr_forward_push.cpp Outdated

@kmontemayor2-sc kmontemayor2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matt!

Comment thread gigl-core/core/sampling/ppr_forward_push.cpp

@kmontemayor2-sc kmontemayor2-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matt!

@mkolodner-sc
mkolodner-sc marked this pull request as ready for review August 5, 2026 08:26
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/typed-channel-ppr-cpp branch from 7eecb35 to 8594c84 Compare August 5, 2026 08:39
@mkolodner-sc
mkolodner-sc added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 16f08b8 Aug 5, 2026
7 checks passed
@mkolodner-sc
mkolodner-sc deleted the mkolodner-sc/typed-channel-ppr-cpp branch August 5, 2026 10:54
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.

3 participants