Skip to content

Comments

Add regression test for recursive BackwardDifferentiable hang (#10066)#10067

Open
rkoivunen-sw wants to merge 1 commit intoshader-slang:masterfrom
rkoivunen-sw:test/recursive-backward-diff-hang
Open

Add regression test for recursive BackwardDifferentiable hang (#10066)#10067
rkoivunen-sw wants to merge 1 commit intoshader-slang:masterfrom
rkoivunen-sw:test/recursive-backward-diff-hang

Conversation

@rkoivunen-sw
Copy link

Adds regression test for #10066

The test uses //TEST_IGNORE_FILE: because the unfixed compiler hangs. It will be ignored by CI until the bug is fixed. To verify manually:

timeout 5 slangc tests/bugs/recursive-backward-diff-hang.slang -target glsl -entry computeMain -stage compute -o /dev/null
# Exit 124 = timeout (confirming hang)

@rkoivunen-sw rkoivunen-sw requested a review from a team as a code owner February 18, 2026 20:46
@CLAassistant
Copy link

CLAassistant commented Feb 18, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds a new ignored regression test that reproduces a hang in the backward-differentiation path by invoking the backward-diff extension on a recursive BackwardDifferentiable function.

Changes

Cohort / File(s) Summary
Regression Test
tests/bugs/recursive-backward-diff-hang.slang
Added a new TEST_IGNORE_FILE regression test that defines BackwardDifferentiable recursiveSum(float x, int n) and invokes __bwd_diff on a DifferentialPair<float> to reproduce a hang; includes manual timeout-based reproduction steps.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 I hopped through calls both near and far,
A halting trace beneath the star,
I planted a test to stop and stare,
A timeout carrot hidden there. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding a regression test for a specific bug (recursive BackwardDifferentiable hang #10066).
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the regression test, why it uses TEST_IGNORE_FILE, and how to manually verify the bug.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/bugs/recursive-backward-diff-hang.slang`:
- Around line 7-8: Update the manual reproduction comment to use the correct
filename: replace the incorrect `bug-report-03-recursive-hang.slang` string with
`recursive-backward-diff-hang.slang` in the reproduction command comment so the
timeout example matches the actual file name; look for the reproduced command
line containing `timeout 10 ... -entry computeMain -stage compute` and edit that
filename.

@rkoivunen-sw rkoivunen-sw force-pushed the test/recursive-backward-diff-hang branch from 80b91d8 to 21280fb Compare February 18, 2026 20:51
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/bugs/recursive-backward-diff-hang.slang`:
- Around line 1-8: The two manual repro command lines in the comment block are
inconsistent; update them so both use the same timeout and target to avoid
confusion (e.g., change "timeout 5 slangc recursive-backward-diff-hang.slang
-target glsl -entry computeMain -stage compute" to match "timeout 10 slangc
recursive-backward-diff-hang.slang -target spirv -entry computeMain -stage
compute" or vice versa). Locate the two command strings ("timeout 5 slangc ..."
and "timeout 10 slangc ...") in the file and make them identical (same timeout
value and same -target) so the documentation is unambiguous.

Comment on lines 1 to 8
// Regression test for https://github.com/shader-slang/slang/issues/10066
// Compiler hangs on recursive [BackwardDifferentiable]. Uses TEST_IGNORE_FILE until fixed.
// Run manually: timeout 5 slangc recursive-backward-diff-hang.slang -target glsl -entry computeMain -stage compute

//TEST_IGNORE_FILE:

// To reproduce the hang manually (with timeout):
// timeout 10 slangc recursive-backward-diff-hang.slang -target spirv -entry computeMain -stage compute
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Align the two manual repro commands to avoid confusion.

You currently document two different timeouts/targets. Consider consolidating or making them identical so the instructions are unambiguous.

💡 Suggested alignment
-// Run manually: timeout 5 slangc recursive-backward-diff-hang.slang -target glsl -entry computeMain -stage compute
+// Run manually: timeout 5 slangc recursive-backward-diff-hang.slang -target glsl -entry computeMain -stage compute
 ...
-// To reproduce the hang manually (with timeout):
-//   timeout 10 slangc recursive-backward-diff-hang.slang -target spirv -entry computeMain -stage compute
+// To reproduce the hang manually (with timeout):
+//   timeout 5 slangc recursive-backward-diff-hang.slang -target glsl -entry computeMain -stage compute
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/bugs/recursive-backward-diff-hang.slang` around lines 1 - 8, The two
manual repro command lines in the comment block are inconsistent; update them so
both use the same timeout and target to avoid confusion (e.g., change "timeout 5
slangc recursive-backward-diff-hang.slang -target glsl -entry computeMain -stage
compute" to match "timeout 10 slangc recursive-backward-diff-hang.slang -target
spirv -entry computeMain -stage compute" or vice versa). Locate the two command
strings ("timeout 5 slangc ..." and "timeout 10 slangc ...") in the file and
make them identical (same timeout value and same -target) so the documentation
is unambiguous.

@rkoivunen-sw rkoivunen-sw force-pushed the test/recursive-backward-diff-hang branch from 21280fb to 53fd9ca Compare February 18, 2026 20:55
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