Skip to content

Move SASS diff description to a SKILL - #9767

Merged
bernhardmgruber merged 4 commits into
NVIDIA:mainfrom
bernhardmgruber:sass_diff_skill
Jul 15, 2026
Merged

bernhardmgruber merged 4 commits into
NVIDIA:mainfrom
bernhardmgruber:sass_diff_skill

Conversation

@bernhardmgruber

Copy link
Copy Markdown
Contributor

Fixes: #7829

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 9, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Added guidance for comparing generated CUDA SASS or PTX between builds, including setup requirements, comparison rules, and reporting expectations.
    • Documented how to identify meaningful differences in instructions, memory access, control flow, register usage, spills, shared memory, and occupancy.
    • Removed the SASS diff guidance from the general agent instructions, consolidating it in the dedicated documentation.

Walkthrough

The SASS diff instructions are removed from AGENTS.md and added as a standalone sass-diff skill covering compilation, disassembly, normalization, comparison, and reporting requirements.

Changes

SASS diff skill relocation

Layer / File(s) Summary
Standalone SASS diff skill specification
.agent/skills/sass-diff/SKILL.md, AGENTS.md
The standalone skill defines CUDA architecture inputs, matching compilation flags, SASS/PTX extraction, trivial-difference rules, and reporting requirements; the corresponding AGENTS.md section is removed.

Assessment against linked issues

Objective Addressed Explanation
Move SASS diff instructions from AGENTS.md into a structured standalone skill, including inputs, compilation, extraction, normalization, comparison, reporting, and matching compiler flags [#7829] ✅

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 80db501d-a267-462f-ad53-e71ae893129b

📥 Commits

Reviewing files that changed from the base of the PR and between f51b10a and f956a5f.

📒 Files selected for processing (3)
  • .agent/skills/sass-diff/SKILL.md
  • .claude/skills/sass-diff/SKILL.md
  • AGENTS.md
💤 Files with no reviewable changes (1)
  • AGENTS.md

Comment thread .agent/skills/sass-diff/SKILL.md Resolved
Comment thread .agent/skills/sass-diff/SKILL.md Resolved
Comment thread .claude/skills/sass-diff/SKILL.md Resolved
Comment thread .agent/skills/sass-diff/SKILL.md Resolved
Comment on lines +18 to +19
* The CUDA SM architectures to compile for. Try to detect this from the code and offer the user a list of suggestions.
The user must confirm or provide this list.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would note that the bot should also check the compile_commands.json to get a definitive answer for this. The architectures will be listed explicitly in the compiler flags.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No it shouldn't. compile_commands.json is what the user compiles for but not necessarily what SM architectures you want to SASS diff. For example, I develop with only SM120 in CMAKE_CUDA_ARCHITECTURES, but every time I SASS-diff I lookup in the tuning headers what SM arches could be impacted by the change and then ask to diff for those.

@bernhardmgruber bernhardmgruber Jul 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I understand now, reworded a bit.

Comment thread .agent/skills/sass-diff/SKILL.md Resolved
Comment thread .agent/skills/sass-diff/SKILL.md Resolved
Comment thread .agent/skills/sass-diff/SKILL.md Resolved
@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

I think I understand now where some of the confusion came from. I mixed up the inputs section with how the binaries are compiled. I expanded a little bit, maybe that clarifies.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7599f1c8-f2da-4fc8-8517-a310524bfda4

📥 Commits

Reviewing files that changed from the base of the PR and between 9a3165a and e9fe056.

📒 Files selected for processing (3)
  • .agent/skills/sass-diff/SKILL.md
  • .agent/skills/sass-diff/normalize_codegen.py
  • AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • AGENTS.md

Comment on lines +21 to +22
line = re.sub(r"0x[0-9a-fA-F]+", "0xHEX", line)
line = re.sub(r"\b[0-9a-fA-F]{16,}\b", "HEX", line)

@coderabbitai coderabbitai Bot Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift

critical: Preserve semantic immediates and label identity.

normalize_common() replaces every hexadecimal literal and long numeric token, so meaningful operands such as 0x1 and 64-bit constants can disappear from the diff. normalize_ptx() also maps every distinct $L__... label to the same placeholder, which can hide branch-target and control-flow changes. Restrict numeric normalization to known metadata fields and canonicalize labels with a per-input mapping that preserves distinct identities.

Also applies to: 40-40

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

claude argued the same.I think I am going to remove normalization for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bernhardmgruber Sounds good — removing normalization avoids the risk of masking semantic diffs. Let me know if you want another look once that change lands.

@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

I removed the SASS normalization again. Let's discuss this at some point in the future.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
.agent/skills/sass-diff/SKILL.md (4)

26-30: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

important: Build both sources in isolated, fresh outputs.

The workflow does not require clean or separate build directories/output paths. An incremental build can reuse an object or binary from the other source, producing a false SASS diff. Require isolated baseline/comparison builds and verify that both binaries were rebuilt with the same flags.


34-40: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

important: Do not treat global function renames as unconditional noise.

A renamed, added, or removed kernel can become unmatched or be compared against the wrong symbol. Match kernels one-to-one first, report additions/removals, and ignore a name-only change only after that mapping is established.


22-22: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

important: define PTX-specific reporting rules. PTX diff is supported, but the contract still doesn't say where register-count, spill/local-memory, shared-memory, or occupancy deltas come from; add a mode-specific source/command for each metric or limit those fields to SASS-only.


17-19: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

important: Compare each approved SM architecture independently. Add one SASS/PTX diff per SM and label the architecture in each result; otherwise architecture-specific changes can be mixed together.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c7498530-f563-49b8-be99-a13b7bdf8701

📥 Commits

Reviewing files that changed from the base of the PR and between e9fe056 and d09845a.

📒 Files selected for processing (1)
  • .agent/skills/sass-diff/SKILL.md

@Jacobfaib Jacobfaib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A shame we couldn't get the SASS normalization scripts to work, but thinking about it a bit more, that might actually be a NP-hard problem in disguise ;)

@bernhardmgruber
bernhardmgruber merged commit d96ec97 into NVIDIA:main Jul 15, 2026
23 of 24 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jul 15, 2026
@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

A shame we couldn't get the SASS normalization scripts to work, but thinking about it a bit more, that might actually be a NP-hard problem in disguise ;)

We can definitely try that in a follow-up!

@bernhardmgruber
bernhardmgruber deleted the sass_diff_skill branch July 15, 2026 12:08
davebayer pushed a commit to davebayer/cccl that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Move SASS diff instructions from AGENTS.md to SKILLS.md

4 participants