Skip to content

Implement fallback frame matching by function name and module (Fixes VROOM-5B)#663

Draft
cursor[bot] wants to merge 3 commits intomainfrom
cursor/frame-matching-fallback-logic-34b8
Draft

Implement fallback frame matching by function name and module (Fixes VROOM-5B)#663
cursor[bot] wants to merge 3 commits intomainfrom
cursor/frame-matching-fallback-logic-34b8

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Mar 19, 2026

Description

This PR implements fallback frame matching by function name and module to fix the issue where a regressed function's fingerprint doesn't match any frame in the profile data.

Problem

When the client sends a regressed function payload with a fingerprint, GetFrameWithFingerprint fails to find a matching frame because:

  1. The fingerprint computed by the client SDK differs from vroom's computation
  2. Differences in module/package extraction (e.g., trimPackage behavior)
  3. Edge cases in fingerprint computation (format, encoding, normalization)

This results in the error "Unable to find matching frame" and the regressed function is skipped.

Solution

Implemented a multi-tiered fallback approach:

  1. First attempt: Exact fingerprint match (existing behavior)
  2. Fallback: Try alternative fingerprint calculations for each frame:
    • Raw package path instead of trimmed package
    • File path instead of module/package
    • Module alone (ignoring package)
    • Function name alone (empty module)

Key Changes

  • Added FindFrameByFingerprintWithFallback() helper function in the frame package
  • Updated GetFrameWithFingerprint() in:
    • SampleChunk (chunk/sample.go)
    • AndroidChunk (chunk/android.go)
    • sample.Profile (sample/sample.go)
    • profile.Android (profile/android.go)
  • Added structured logging when fallback matching is used, including:
    • Target fingerprint
    • Matched frame fingerprint
    • Function name and module
    • Profile/Chunk IDs for debugging
  • Added comprehensive tests for fallback functionality
  • Graceful degradation: if both exact and fallback fail, returns ErrFrameNotFound

Testing

  • All existing tests pass
  • Added new tests in frame_fallback_test.go covering:
    • Exact matches
    • Fallback matches with different fingerprint variations
    • No match scenarios
    • Fingerprint variation computation

Impact

  • Increases resilience when fingerprint computation differs between client and server
  • Provides debugging visibility through structured logging
  • No breaking changes - existing exact match behavior is preserved
  • Graceful fallback only when needed

Fixes VROOM-5B

Open in Web Open in Cursor 

Fixes VROOM-5B

This commit adds fallback frame matching functionality to handle cases where
the fingerprint computed by the client SDK doesn't match any frame in the
profile data due to differences in fingerprint computation.

Key changes:
- Added FindFrameByFingerprintWithFallback() helper function in frame package
  that tries alternative fingerprint calculations (raw package, file, module
  variations) when exact fingerprint match fails
- Updated GetFrameWithFingerprint() in SampleChunk, AndroidChunk, sample.Profile,
  and profile.Android to use fallback matching
- Added structured logging to track when fallback matching is used, including
  target fingerprint, matched frame details, and profile/chunk IDs for debugging
- Added comprehensive tests for the fallback matching functionality
- Graceful degradation: if both exact and fallback matching fail, returns the
  existing ErrFrameNotFound error

The fallback approach computes fingerprint variations for each frame by trying
different normalizations of module/package names (raw package path, file path,
empty module, etc.) to account for differences in how client SDKs and vroom
compute fingerprints.
- Run gofmt on all modified files
- Add period to comment in frame_fallback_test.go
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