Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computer graphics issue fix #203

Merged

Conversation

sudo-panda
Copy link
Contributor

Fixes #167

Modify 'ForwardModeVisitor::VisitCallExpr' to delay the multi-arg assert to ensure the corresponding 'custom_derivative' is found.

P.S. there is a minor refactoring to make the overloadExists function name match its return value.

overloadExists returns true when there is no
overload present so it should be called
noOverloadExists
When custom derivatives of a function exists it does not need to be checked for multi-args
@codecov
Copy link

codecov bot commented Feb 27, 2021

Codecov Report

Merging #203 (7e45e45) into master (1e6491b) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #203      +/-   ##
==========================================
+ Coverage   83.92%   83.96%   +0.04%     
==========================================
  Files          13       13              
  Lines        2650     2651       +1     
==========================================
+ Hits         2224     2226       +2     
+ Misses        426      425       -1     
Impacted Files Coverage Δ
include/clad/Differentiator/DerivativeBuilder.h 99.04% <ø> (ø)
lib/Differentiator/DerivativeBuilder.cpp 91.25% <100.00%> (+0.05%) ⬆️
Impacted Files Coverage Δ
include/clad/Differentiator/DerivativeBuilder.h 99.04% <ø> (ø)
lib/Differentiator/DerivativeBuilder.cpp 91.25% <100.00%> (+0.05%) ⬆️

@vgvassilev
Copy link
Owner

Thanks for the PR, looks good to me. Since we do not still have an infrastructure to check fixed assertions (see #157) we will do it manually next week.

@vgvassilev
Copy link
Owner

The PR seems to fix the issue. Could you add this diff to it to make sure we see consistent behavior in the bots:

diff --git a/test/Misc/RunDemos.C b/test/Misc/RunDemos.C
index da13c67..2815cb6 100644
--- a/test/Misc/RunDemos.C
+++ b/test/Misc/RunDemos.C
@@ -2,6 +2,7 @@
 // RUN: %cladclang %S/../../demos/ControlFlow.cpp -I%S/../../include 2>&1
 // RUN: %cladclang %S/../../demos/DebuggingClad.cpp -I%S/../../include 2>&1
 // RUN: %cladclang %S/../../demos/RosenbrockFunction.cpp -I%S/../../include 2>&1
+// RUN: %cladclang %S/../../demos/ComputerGraphics/SmallPT.cpp -I%S/../../include 2>&1
 
 
 //-----------------------------------------------------------------------------/
@@ -95,4 +96,4 @@
 //-----------------------------------------------------------------------------/
 // Demo: ODE Solver Sensitivity
 //-----------------------------------------------------------------------------/
-// RUN: %cladclang -lstdc++ %S/../../demos/ODESolverSensitivity.cpp -I%S/../../include -oODESolverSensitivity.out
\ No newline at end of file
+// RUN: %cladclang -lstdc++ %S/../../demos/ODESolverSensitivity.cpp -I%S/../../include -oODESolverSensitivity.out

@sudo-panda
Copy link
Contributor Author

@vgvassilev sure

@vgvassilev
Copy link
Owner

Could you also add regression tests for the fixed cases?

@sudo-panda
Copy link
Contributor Author

Could you also add regression tests for the fixed cases?

@vgvassilev I am also working on a fix for pow in reverse mode can I add the tests after I fix that or would it be better to do it right now?

@vgvassilev
Copy link
Owner

Please add it at your convenience. Definitely should be before merging this PR though.

test/Misc/RunDemos.C Outdated Show resolved Hide resolved
Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Great work! Thanks!

@vgvassilev vgvassilev merged commit b62af25 into vgvassilev:master Mar 2, 2021
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.

Computer graphics demo fails on pow
2 participants