Skip to content

Scratch/riel/identity v12 - #108

Merged
rikvanriel merged 5 commits into
facebookexperimental:mainfrom
rikvanriel:scratch/riel/identity-v12
Nov 8, 2026
Merged

rikvanriel merged 5 commits into
facebookexperimental:mainfrom
rikvanriel:scratch/riel/identity-v12

Conversation

@rikvanriel

Copy link
Copy Markdown
Contributor

various fixes for the symbol identity work that slipped through the cracks at first

The --include flag was accepted by the CLI but never read, and the
manifest walk covered the whole repo tree at HEAD however narrow the
source directory. Every scoped run therefore indexed the entire tree:
harmless on a small checkout, but on the Linux kernel it looks like a
hang, tens of CPU-minutes with zero database writes until the first
2048-file batch lands.

Compute repo-relative scope prefixes from the source dir and each
--include dir, filter manifest entries by whole-segment prefix match,
and log the effective scope at startup. Query-time reindex paths keep
whole-tree behavior. Adds unit tests for the prefix computation.
enclosing_owner_edge only recognized C++ this and Python self, so
every plain receiver.method() call in Rust fell through to the
dispatch table and vanished from call tracing. Turbofished and chained
calls survived through the generic-function arm, which is why only the
bare self.read(offset) shape went missing.

A Rust self names the enclosing impl the way a Python self names the
enclosing class, so it gets the same tagged edge beside the call.
self.printk(..) now records its owner instead of disappearing.
A qualified callers query never matched a tagged member edge: the
lookup compared the full path against stored spellings, and tagged
edges store only the bare call beside its owner. callers Io::read
came back empty while the edges sat in the database.

The matcher now reads both halves of every edge. A bare query keeps
the old projection semantics; a qualified query additionally matches a
tagged edge whose owner the path names. A plain edge never addresses a
qualified target, and a verbatim path edge still matches only its full
spelling. Adds unit tests for the matcher.
The scope filter and the Rust self arm both arrived without a test
that fails on the old code. These do: the same fixture indexes
drivers/x.c when the scope is empty but must not when it is bounded,
and a bare self.read() must record a tagged edge the reverse lookup
can find. The self-call test was verified to fail with the old
analyzer in place.
An array subscript names no member: table[i](...) in one driver
spells exactly like handlers[j](...) in another, so joining every
dispatch site on the bare [] member links every dispatch table in
the tree to every array-installed function. bfa_msix and a sound
codec showed up as dispatchers of kvm_handle_invalid_op this way.

Keep the strong matches (receiver type ties the site to the table)
and the weak named-member matches, but drop a member-name match on
[] with no receiver type behind it: without a type it cannot tell
one table from another. Adds unit tests for both halves and an end
to end test with two same-shaped tables.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@rikvanriel
rikvanriel merged commit 8a594b6 into facebookexperimental:main Nov 8, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant