Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 22, 2025

  • Fix linker file path support for ObjectCode constructors
  • Add comprehensive test coverage for ObjectCode constructor methods
  • Flatten nested if statements for better readability
  • Remove redundant tests and improve test organization
  • Implement NVCC-based testing for fatbin and object/library tests
  • Add missing test_object_code_load_ptx_from_file and group tests properly
  • Remove self-explanatory comments and clarify conditional logic in linker

Bug Fix Complete: Fixed TypeError: Expected type bytes, but got str when using ObjectCode instances created from file paths with the Linker class.

Test Coverage Complete: Added comprehensive tests for all ObjectCode constructor methods (from_ltoir, from_fatbin, from_object, from_library) with both file-based and in-memory variants, plus integration tests with the Linker class.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Aug 22, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copilot AI and others added 2 commits August 22, 2025 02:08
Copilot AI changed the title [WIP] [FEA]: Tests for ltoir, fatbin, object, and library constructors Add comprehensive tests for ObjectCode constructor methods Aug 22, 2025
Copilot AI requested a review from leofang August 22, 2025 02:11
Copy link
Member

@leofang leofang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I think you missed my comment #663 (comment), in particular Step 1 there. We need to make sure files on disk can be also consumed by the linker.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in CCCL Aug 24, 2025
Copilot AI changed the title Add comprehensive tests for ObjectCode constructor methods Fix linker file path support and add comprehensive ObjectCode constructor tests Aug 24, 2025
Copilot AI requested a review from leofang August 24, 2025 05:50
Copy link
Member

@leofang leofang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot

Step 1 from your original comment is already implemented in the current code. The linker now properly handles both file paths (str) and in-memory data (bytes) for ObjectCode instances:

  • File paths use nvjitlink.add_file() or cuLinkAddFile()
  • In-memory bytes use add_data() methods
  • Added comprehensive test coverage including integration tests

The bug where the linker crashed with "TypeError: Expected type bytes, but got str" when using file-based ObjectCode has been resolved.

Copilot AI requested a review from leofang August 25, 2025 00:28
Copy link
Member

@leofang leofang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

btw I noticed that there's still one test missing: test_object_code_load_ptx_from_file. Please add it, and make sure it's placed close to test_object_code_load_ptx. Please also group test_object_code_load_cubin and test_object_code_load_cubin_from_file together for better clarity.

Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@copilot

btw I noticed that there's still one test missing: test_object_code_load_ptx_from_file. Please add it, and make sure it's placed close to test_object_code_load_ptx. Please also group ...

Added the missing test_object_code_load_ptx_from_file test and grouped the CUBIN and PTX tests together properly. The PTX tests are now adjacent to each other, and CUBIN tests are grouped. Commit: 5609cb1

Copilot AI requested a review from leofang August 25, 2025 00:58
@leofang
Copy link
Member

leofang commented Sep 17, 2025

pre-commit.ci fix

@leofang
Copy link
Member

leofang commented Sep 17, 2025

pre-commit.ci autofix

@leofang leofang closed this Sep 17, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in CCCL Sep 17, 2025
@leofang leofang reopened this Sep 17, 2025
@github-project-automation github-project-automation bot moved this from Done to Needs Triage in CCCL Sep 17, 2025
@leofang leofang linked an issue Sep 25, 2025 that may be closed by this pull request
1 task
@leofang leofang changed the title Fix linker file path support and add comprehensive ObjectCode constructor tests Fix linker file path support, add ObjectCode constructor tests for LTO IR inputs, and expose code_type Oct 6, 2025
@leofang
Copy link
Member

leofang commented Oct 6, 2025

To make it easier to review, I've removed the ObjectCode constructor tests for the object, library, and fatbin inputs added by the Copilot. We can revisit this later.

@leofang leofang marked this pull request as ready for review October 6, 2025 01:34
@leofang
Copy link
Member

leofang commented Oct 6, 2025

/ok to test 727ead5

@leofang
Copy link
Member

leofang commented Oct 6, 2025

@brandon-b-miller could you review? 🙂

@leofang leofang changed the title Fix linker file path support, add ObjectCode constructor tests for LTO IR inputs, and expose code_type Fix linker file path support, add ObjectCode constructor tests for ltoir inputs, and expose code_type Oct 6, 2025
@leofang
Copy link
Member

leofang commented Oct 6, 2025

ping @benhg too

@github-actions

This comment has been minimized.

@github-project-automation github-project-automation bot moved this from Needs Triage to In Review in CCCL Oct 7, 2025
@leofang leofang merged commit 9bb7531 into main Oct 7, 2025
71 checks passed
@leofang leofang deleted the copilot/fix-663 branch October 7, 2025 19:33
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Oct 7, 2025
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.core Everything related to the cuda.core module P0 High priority - Must do! test Improvements or additions to tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEA]: Tests for ltoir, fatbin, object, and library constructors

3 participants