Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/ripr/src/analysis/language/perl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3246,6 +3246,14 @@ struct RangeFact {
end_column: usize,
}

/// Canonical Perl gap ID using FNV-1a 64-bit.
///
/// This uses the **same FNV-1a constants** as the Rust seam ID
/// (`crates/ripr/src/analysis/seams.rs:313`), the canonical gap ID
/// (`crates/ripr/src/analysis/canonical_gap.rs:128`), and the seam cache
/// (`crates/ripr/src/analysis/seam_cache.rs:1411`). This is deliberate
/// parity: all gap/seam IDs across languages use one hash scheme so they
/// are comparable in corpus ledgers and traceability edges. See #1722.
fn canonical_perl_gap_id<'a>(parts: impl IntoIterator<Item = &'a str>) -> String {
const FNV_OFFSET: u64 = 0xcbf29ce484222325;
const FNV_PRIME: u64 = 0x100000001b3;
Expand Down
6 changes: 6 additions & 0 deletions crates/ripr/src/analysis/seams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ fn normalize_path(p: &Path) -> String {
/// `std::collections::hash_map::DefaultHasher`, which is intentionally not
/// stable across releases. The hash never reads time, walk order, process
/// ID, or any other ambient state.
///
/// This uses the **same FNV-1a constants** as the Perl gap ID
/// (`crates/ripr/src/analysis/language/perl/mod.rs:3249`), the canonical
/// gap ID (`crates/ripr/src/analysis/canonical_gap.rs:128`), and the seam
/// cache (`crates/ripr/src/analysis/seam_cache.rs:1411`). Deliberate
/// parity: all gap/seam IDs across languages use one scheme. See #1722.
fn compute_seam_id(file: &str, owner: &str, kind: SeamKind, byte_offset: usize) -> SeamId {
const FNV_OFFSET: u64 = 0xcbf29ce484222325;
const FNV_PRIME: u64 = 0x100000001b3;
Expand Down
Loading