Make Kernel Source Code Discoverable - #514
Open
ZwFink wants to merge 2 commits into
Open
Conversation
The pass now resolves the source path of the non-LTO translation-unit module to an absolute real path before embedding it. Consumers of the embedded bitcode, such as Mneme's recorder, can then locate the kernel's translation unit without knowing the compile working directory. Only the emitted clone is modified; the original module keeps its name so getUniqueFileID and host/device matching are unchanged. The path is already part of the module hash, so hashes only change when the compile was invoked with a relative path or a path through a symlink.
The cleanup pipelines stripped all debug info from device modules, so the bitcode that Mneme embeds and records carried no source information and a recorded kernel could not be traced back to the code that defined it. Downgrade to line tables instead of stripping, in the pass cleanup pipeline, in the HIP RDC/LTO pruned module, and in the runtime cleanup pipeline. That keeps each kernel's DISubprogram and DIFile, including the compile-time MD5 checksum, while dropping the type and variable debug info that made modules large.
ZwFink
force-pushed
the
canonical-source-filename
branch
from
September 2, 2026 23:19
5fbcc4b to
7410e0b
Compare
johnbowen42
approved these changes
Sep 3, 2026
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.
Embed the source filename into the resulting module. This can be helpful for downstream users such as Mneme to find the original kernel source code.