Skip to content

Users/ftynse/hotswap llvm error#2559

Draft
ftynse wants to merge 3 commits into
users/tgymnich/hotswap-pr-02-code-object-metadatafrom
users/ftynse/hotswap-llvm-error
Draft

Users/ftynse/hotswap llvm error#2559
ftynse wants to merge 3 commits into
users/tgymnich/hotswap-pr-02-code-object-metadatafrom
users/ftynse/hotswap-llvm-error

Conversation

@ftynse
Copy link
Copy Markdown

@ftynse ftynse commented May 15, 2026

No description provided.

martin-luecke and others added 3 commits May 15, 2026 15:05
Adds the AMDGPU code-object metadata extraction surface that the rest of
the raiser pipeline depends on:

* `extractTextSection`, `listKernelNames`, `extractKernelMeta`,
  `findKernelSymbolOffset`, and `detectIsaFromElf` in
  `hotswap/code_object_utils.{h,cpp}`.
* `KernelMeta` populated with both MsgPack-derived fields (kernarg/group/
  private segment sizes, args) and the raw kernel-descriptor register
  bytes (`compute_pgm_rsrc{1,2}`, `kernel_code_properties`,
  `kernarg_preload`) read from `<name>.kd` in `.rodata`. Later layers
  (`UserSgprLayout`, kernarg layout) consume these.

Reuses comgr's existing parsing infrastructure rather than duplicating
it: each helper wraps the input ELF bytes in an
`AMD_COMGR_DATA_KIND_EXECUTABLE` data object via a small
`ScopedDataObject` RAII helper and routes through
`metadata::getMetadataRoot` / `metadata::getElfIsaName` for the metadata
walk and ISA-name extraction. No new entry points are added to
`comgr-metadata.{h,cpp}`. Tests + raise_cli pick up `amd_comgr` on their
link line so the public C entry points
(`amd_comgr_create_data` / `set_data` / `release_data`) resolve.

Includes a small focused gtest covering empty-input and malformed-ELF
guards on the public hotswap API.

No MC stack, no disassembler, no opcode canonicalisation yet — those
land in subsequent commits.

Co-Authored-By: Tim Gymnich <tim@gymni.ch>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Use the established mechanism rather than blindly dumping error messages
to the error stream and signaling error state through a variety of
fields. Introduce an error subclass so we can tell the errors hotswap
produced apart from external-origin errors.

Signed-off-by: Alex Zinenko <git@ozinenko.com>
Use established LLVM mechanisms instead of handrolled classes.

Signed-off-by: Alex Zinenko <git@ozinenko.com>
@tgymnich tgymnich force-pushed the users/tgymnich/hotswap-pr-02-code-object-metadata branch 5 times, most recently from e20dd25 to 877df15 Compare May 18, 2026 14:38
@ftynse ftynse force-pushed the users/tgymnich/hotswap-pr-02-code-object-metadata branch from 877df15 to 9428a8b Compare May 21, 2026 11:31
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.

2 participants