Skip to content

fix(nvtx): share injection hook through dylib - #543

Merged
rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
9prady9:pr/injection-fix
Aug 7, 2026
Merged

rapids-bot[bot] merged 1 commit into
rapidsai:mainfrom
9prady9:pr/injection-fix

Conversation

@9prady9

@9prady9 9prady9 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route static NVTX initialization through a shared Rust hook instance
  • keep the public NVTX entrypoint available while avoiding duplicate in-process hook state
  • update static-injection docs/comments to match the actual fnptr-based mechanism

Testing

  • pixi run cargo test -p nvtx-injection --locked
  • pixi run cargo test -p nvtx-injection --features static-injection --locked
  • pixi run cargo clippy -p nvtx-injection --all-targets --all-features --locked -- -D warnings

@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: aad2fd2e-36c8-4e5a-bdc2-954823ceb491

📥 Commits

Reviewing files that changed from the base of the PR and between 2f60470 and 4be3f46.

📒 Files selected for processing (2)
  • ui/packages/@quent/components/src/dag/DataFlowMatrix.tsx
  • ui/packages/@quent/components/src/query-plan/NodeFlowBar.tsx

📝 Walkthrough

Walkthrough

The PR changes NVTX injection linkage to use a private static-build entry symbol and preserves the runtime-loaded symbol. It also reformats JSX in two UI components without changing behavior.

Changes

NVTX injection linkage

Layer / File(s) Summary
Conditional injection entry linkage
integrations/nvtx/injection/...
The crate, Rust exports, C trampoline, public alias, and static-injection documentation now use quent_InitializeInjectionNvtx2 for static builds and retain InitializeInjectionNvtx2 for runtime-loaded builds.

UI component formatting

Layer / File(s) Summary
JSX layout formatting
ui/packages/@quent/components/src/dag/DataFlowMatrix.tsx, ui/packages/@quent/components/src/query-plan/NodeFlowBar.tsx
JSX declarations and conditional class-name expressions are reformatted without changing runtime behavior or component APIs.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • rapidsai/quent#391: Directly changes the NVTX injection crate and initialization symbol handling.
  • rapidsai/quent#402: Directly refines NVTX injection symbols and static-injection configuration.
  • rapidsai/quent#474: Shares changes in integrations/nvtx/injection/src/init.rs, but addresses different functionality.

Suggested labels: improvement

Suggested reviewers: johanpel, mbrobbel, dhruv9vats

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main NVTX change: sharing the injection hook through a dynamic library.
Description check ✅ Passed The description explains the change and lists relevant Rust tests, but it omits the template headings for related issues and screenshots.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
ui/packages/@quent/components/src/lib/useTimelineWheelNavigation.ts-69-72 (1)

69-72: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use clientX at the viewport edge.

clientX === 0 is a valid pointer coordinate. Lines 70-72 replace it with the chart center. A Shift+wheel event at the left viewport edge then zooms around the center instead of the cursor.

Calculate localX directly from event.clientX. Add a regression test with clientX: 0 and assert that start remains at the current start bound.

Proposed fix
-          const localX =
-            event.clientX > 0
-              ? event.clientX - rect.left - TIMELINE_SPACING.left
-              : usableWidth / 2;
+          const localX = event.clientX - rect.left - TIMELINE_SPACING.left;

As per path instructions, cover meaningful boundaries.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/packages/`@quent/components/src/lib/useTimelineWheelNavigation.ts around
lines 69 - 72, Update the localX calculation in the timeline wheel navigation
handler to use event.clientX directly, so a valid coordinate of 0 is converted
relative to rect.left and TIMELINE_SPACING.left rather than replaced with
usableWidth / 2. Add a regression test for Shift+wheel with clientX: 0 and
assert that start remains at the current start bound.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integrations/nvtx/injection/Cargo.toml`:
- Line 13: Update the crate-type configuration for the nvtx-injection package to
include both cdylib and rlib targets, preserving the existing rlib output while
restoring the runtime library required by NVTX_INJECTION64_PATH when
static-injection is disabled.

---

Other comments:
In `@ui/packages/`@quent/components/src/lib/useTimelineWheelNavigation.ts:
- Around line 69-72: Update the localX calculation in the timeline wheel
navigation handler to use event.clientX directly, so a valid coordinate of 0 is
converted relative to rect.left and TIMELINE_SPACING.left rather than replaced
with usableWidth / 2. Add a regression test for Shift+wheel with clientX: 0 and
assert that start remains at the current start bound.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: a6945b7d-b769-4e72-b056-9ddef6446bb7

📥 Commits

Reviewing files that changed from the base of the PR and between 6f4b9c6 and 2f60470.

📒 Files selected for processing (6)
  • integrations/nvtx/injection/Cargo.toml
  • integrations/nvtx/injection/c/symbol.c
  • integrations/nvtx/injection/src/init.rs
  • integrations/nvtx/injection/src/lib.rs
  • ui/packages/@quent/components/src/lib/useTimelineWheelNavigation.test.ts
  • ui/packages/@quent/components/src/lib/useTimelineWheelNavigation.ts

Comment thread integrations/nvtx/injection/Cargo.toml
@9prady9
9prady9 force-pushed the pr/injection-fix branch 2 times, most recently from 4be3f46 to 0c5a4c1 Compare August 7, 2026 10:12
@9prady9

9prady9 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit b662498 into rapidsai:main Aug 7, 2026
37 of 38 checks passed
@9prady9
9prady9 deleted the pr/injection-fix branch August 7, 2026 10:29
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