Skip to content

[SYCL][SYCLBIN] Fix native-AOT object-state cross-library link#22509

Open
koparasy wants to merge 1 commit into
intel:syclfrom
koparasy:fix/aot-object-crosslib-link
Open

[SYCL][SYCLBIN] Fix native-AOT object-state cross-library link#22509
koparasy wants to merge 1 commit into
intel:syclfrom
koparasy:fix/aot-object-crosslib-link

Conversation

@koparasy

@koparasy koparasy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Fix native-AOT object-state cross-library link

Loading an AOT-only object-state SYCLBIN and linking it via sycl::link
did not work end to end. #22196 enabled the importer-side object load
(and shipped a load-only e2e), but a full cross-library link of native
AOT objects hit three defects, none covered by that load-only test.

Bugs fixed

  1. Export-only AOT library not loadable as object.
    SYCLBINBinaries::getBestCompatibleImages gated the native-image
    fallback on getBinImageState(img) == State. An export-only library
    imports nothing, so it classifies as executable and was dropped for
    an object request .

  2. Assertion on loaded image state. The SYCLBIN loader stamped the
    image with its intrinsic state (executable), tripping
    DevImageState == bundle_state::object in
    bringSYCLDeviceImageToState. The created image is now clamped to the
    requested (already-validated) declared state.

  3. Segfault on AOT-only link. kernel_bundle_impl::link always
    invoked ProgramManager::link on the JIT image set; for an AOT-only
    link that set is empty, so urProgramLinkExp was called with zero
    programs and segfaulted in the L0 adapter. The JIT link is now skipped
    when there are no JIT images; AOT images are resolved via
    dynamicLink.

Tests

  • e2e SYCLBIN/link_object_aot.cpp — cross-library link of two
    AOT-only object SYCLBINs on Level Zero (spir64_gen). Exercises the AOT
    partition, ProgramManager::build with AllowUnresolvedSymbols, and
    dynamicLink. Restricted to L0 (REQUIRES: level_zero, ocloc);
  • unit AOTBinaryTarget.cppisAOTBinaryTarget and
    getBinImageState classifiers.
  • unit DynamicLinking.cppbuild with AllowUnresolvedSymbols
    (happy path + program-cache-key bool), and feature_not_supported
    guards on the build and link entry points when the adapter lacks the
    Exp variants.
  • Fixed RuntimeLinkingCommon::clear() to reset the
    CreateWithBinary counter (latent; exposed under --gtest_shuffle).

@koparasy koparasy requested a review from a team as a code owner July 1, 2026 22:06
@koparasy koparasy force-pushed the fix/aot-object-crosslib-link branch from b567a8d to ba19a56 Compare July 1, 2026 22:28
@koparasy

koparasy commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@KseniyaTikhomirova gentle ping about this one. Thank you!

@KseniyaTikhomirova

Copy link
Copy Markdown
Contributor

@0x12CC hi, can you please help with review as SYCLBIN owner?

@KseniyaTikhomirova KseniyaTikhomirova requested a review from 0x12CC July 7, 2026 10:34
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