summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-03-28AD: Warped-Area-Sampling test works now. (#2742)Sai Praveen Bangaru
* Create render.slang * Added higher-order differentiability decorators for built-ins + preliminary tests * Update diff.meta.slang * Copy over conformance synthesis code to `DifferentiableTypeConformanceContext` * Update render.slang * Fixed 1D warped-area sampling test * Update warped-sampling-1d.slang * Remove commented line. * Change WAS test to use fixed point * Replaced InterlockedCmpExchange with InterlockedAdd * Increase fixed point precision * Reduce floating-point precision by 2 digits to avoid platform-specific problems * Dropped another digit (just to be safe) --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-27Translate all composed types into tuple types in pyBind. (#2744)Yong He
* Translate all composed types into tuple types in pyBind. * Delete temp file. * Fix get tuple element code emit logic. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-27Upgrade `slang-llvm` (#2741)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fix SlangCompileTarget to keep ordering. * Add test. Remove V2 version of interface to access IDownstreamCompiler Update to slang-llvm which has _chkstk support. * Update slang.h Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> --------- Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al>
2023-03-27Apply IR simplifcation immediately after specialization to avoid duplicates. ↵Yong He
(#2739) * Apply IR simplifcation immediately after specialization to avoid duplicates. * Update source/slang/slang-ir-specialize.cpp Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al> --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <github@sub.monoid.al>
2023-03-27Using SourceMap for location output (#2736)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP using SourceMap with SourceManager. * Add a test to check obfuscation map is working. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-27Fix lowering crash in [BackwardDerivativeOf]. (#2737)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-26Add PyTorch C++ binding generation. (#2734)Yong He
* Add PyTorch C++ binding generation. * fix --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-24Switch to short circuiting semantics for scalar `?:` operator. (#2733)Yong He
2023-03-24Added `[BackwardDifferentiable]` tags for intrinsic + builtin methods (#2732)Sai Praveen Bangaru
* Added higher-order differentiability decorators for built-ins + preliminary tests * Update diff.meta.slang
2023-03-24Obfuscated source map writing (#2727)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP produce obfuscated source map and write when container is specified. * Make the sourcemap generated name stable.
2023-03-24Fix nested bwdContextType lowering. (#2731)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23Fix various autodiff crashes related to interface usage. (#2730)Yong He
* Fix crash. * Fix `[ForwradDerivative]` on member functions. * Update comments. * Fix crash when [BackwardDerivative] is provided but not [ForwardDerivative]. * Allow calling dynamic dispatched generic method from differentiable func. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23AD: Fix type checking for higher-order custom derivatives definitions (#2729)Sai Praveen Bangaru
* Fixed type coercion issue with higher-order user defined methods * Placed associated type lookup method in a loop * Update high-order-user-defined-derivative.slang * Revert changes to associated type lookup method
2023-03-23Hack handling of primal insts that has a function type. (#2728)Yong He
* Update diff-bwd material test * Minor update * Hack handling of primal insts that has a function type. --------- Co-authored-by: winmad <winmad.wlf@gmail.com> Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23Fix optimization pass not converging. (#2725)Yong He
* Fix optimization pass not converging. * Fix. * Fix tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-23Fix scope fixing for address insts. (#2724)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-22Create a simplified Falcor material system in slang test (#2721)winmad
* Duplicate an example of differentiating Falcor's material system * Add a second BSDF * WIP: update test; grad didn't pass through * Finalize test --------- Co-authored-by: Lifan Wu <lifanw@nvidia.com>
2023-03-22Type legalization and autodiff bug fixes. (#2722)Yong He
* Bug fixes. * Fix. * Only perform autodiff for functions whose derivative is actually used. * Fix loop optimize bug. * Fix high order diff. * Fix trivial diff func generation. * Fixes. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-21[TreatAsDifferentiable] functions. (#2720)Yong He
2023-03-21Fix associated type resolution bug. (#2719)Yong He
* Fix associated type resolution bug. * Fix. * Fix language server hinting messed up by breadcrumb nodes. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-21Fix IntVal type check. (#2718)Yong He
* Fix IntVal type check. * add test case result. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-17Add support for emitting cuda kernel and host functions. (#2712)Yong He
* Add support for emitting cuda kernel and host functions. * Update test. * Fix cuda preamble emit. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-16Fix Phi simplification bug. (#2710)Yong He
* Fix Phi simplification bug. * Fix up. * Fix. * Fix. * Fix. * Fix. * Fix. * Fix test. * Fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-16Fix name mangling of `FuncCallIntVal` in func signatures. (#2709)Yong He
* Fix name mangling of `FuncCallIntVal` in func signatures. * Enhance the test. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-16Add `[CudaDeviceExport]` to allow exporting CUDA device functions. (#2708)Yong He
* Add `[CudaDeviceExport]` to allow exporting CUDA device functions. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-16Add test case for `makeStruct` transcription. (#2705)Yong He
* Add test case for `makeStruct` transcription. * Update documentation on `no_diff`. * Update toc --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-16Support GL_EXT_fragment_shader_barycentric (#2704)Samuel Kogler
* Support GL_EXT_fragment_shader_barycentric * Support pervertex with GL_EXT_fragment_shader_barycentric
2023-03-15AD: Primal-Hoisting Rework + Checkpoint Policy Framework (#2702)Sai Praveen Bangaru
2023-03-15Properly implement differential witness of intermediate context type. (#2699)Yong He
* Properly implement differential witness of intermediate context type. * Modify test to include a loop. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-14Support `fwd_diff(bwd_diff(f))`. (#2697)Yong He
* Support `fwd_diff(bwd_diff(f))`. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-13Support high order diff pattern: `bwd_diff(fwd_diff(f))`. (#2695)Yong He
* Support high order diff pattern: `bwd_diff(fwd_diff(f))`. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-09Update restrictions sections in autodiff doc. (#2694)Yong He
* Update restrictions section in autodiff doc. * Update restrictions sections in autodiff doc. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-08Add support for `[PrimalSubstitute]` and `[PrimalSubstituteOf]`. (#2691)Yong He
* Add support for `[PrimalSubstitute]` and `[PrimalSubstituteOf]`. * Fix * Fix. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-07Reuse higher-order `ResolveInvoke` logic to resolve func refs in ↵Yong He
`[*DerivativeOf]` attribs. (#2688) * Reuse higher-order `ResolveInvoke` logic to resolve func refs in [*DerivativeOf] attribs. * Add diff implementation matrix versions of binary and ternary intrinsics. * Add diff impl for legacy intrinsics. * Fix diagnostics of using non-differentiable function in a diff operator. * Add diff implementation for `determinant`. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-01Implement derivatives for HLSL intrinsics. (#2684)Yong He
* Implement derivatives for HLSL intrinsics. * Vector intrinsics. * Add all intrinsics. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-01Improve diagnostic on differentiablitiy check. (#2687)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-28AD: Fixed do-while loops (#2683)Sai Praveen Bangaru
* WIP: Fix for do-while loops * Added a somewhat hacky fix for do-while loops * Redid the indexed region map builder step to fix issue with the nested loops test * rename * Used managed pointers
2023-02-27Diagnose on storing differentiable value into non-differentiable location. ↵Yong He
(#2681)
2023-02-27More fixes for reverse-mode on complicated loops (#2675)Sai Praveen Bangaru
* Multiple fixes to get various loop tests to pass. * Create reverse-nested-loop.slang * Fix for variables becoming inaccessible during cfg normalization * Removed comments and moved break-branch-normalization to eliminateMultiLevelBreaks * Fix. * Override liveness tests
2023-02-27Detect and deduplicate read-only resource access. (#2680)Yong He
* Detect and deduplicate read-only resource access. * Fix tests. * Fix tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-24Added support for `kIROp_Select` (#2679)Sai Praveen Bangaru
2023-02-24Support dynamic dispatch a backward differentiable function. (#2678)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-24More control flow simplifications. (#2673)Yong He
* More control flow and Phi param simplifications. * Fix. * Fix gcc error. * Fix. * More IR cleanup. * Fix bug in phi param dce + ifelse simplify. * Propagate and DCE side-effect-free functions. * Enhance CFG simplifcation to remove loops with no side effects. * Fix. * Fixes. * Fix tests. Add [__AlwaysFoldIntoUseSite] for rayPayloadLocation. * More cleanup. * Fixes. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-22Fixed hoisting of intermediate array & context vars (#2674)Sai Praveen Bangaru
Also added legalization for loops
2023-02-22Reverse-mode AD fixes for loops with non-trivial break region (#2671)Sai Praveen Bangaru
* Fix crash when applying autodiff to functions with no arguments * Fixes for loops where the break region is non-trivial * Minor fix * Implement array legalization correctly. * Fix array legalization. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-21Fix transposeCall. (#2669)Yong He
* Modify control-flow test case * Update reverse-control-flow-3.slang * Fix `transposeCall`. * Fix. --------- Co-authored-by: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-21Added support for simple while loops (#2667)Sai Praveen Bangaru
* Added support for simple while loops * Fix support for while loops by changing logic to grab the loop update block
2023-02-20Miscellaneous backward autodiff fixes. (#2665)Yong He
* Fix differentiable type registration * Fix use of non-differentiable return value in a differentiable func. * Fix use of primal inst that does not dominate the diff block. * Fix primal inst hoisting, and add missing type legalization logic. * Make `detach` defined on all differentiable T. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-20Add static for loop iteration inference. (#2659)Yong He
2023-02-17Allocate N+1 arrays instead of N to avoid out-of-bounds access when ↵Sai Praveen Bangaru
unzipping loops (#2663)