@@ -1483,14 +1483,18 @@ nb::object FunctionRecording::record(nb::callable func,
1483
1483
JitBackend backend = in_variables.backend ;
1484
1484
1485
1485
frozen_func->recording_counter ++;
1486
- if (frozen_func->recording_counter > frozen_func->warn_recording_count )
1486
+ if (frozen_func->recording_counter > frozen_func->warn_recording_count &&
1487
+ frozen_func->recordings .size () >= 1 ) {
1487
1488
jit_log (
1488
1489
LogLevel::Warn,
1489
1490
" The frozen function has been recorded %u times, this indicates a "
1490
1491
" problem with how the frozen function is being called. For "
1491
- " example, calling it with changing python values such as a "
1492
- " index." ,
1492
+ " example, calling it with changing python values such as an "
1493
+ " index. For more information about which variables changed set the "
1494
+ " log level to ``LogLevel::Debug``." ,
1493
1495
frozen_func->recording_counter );
1496
+ log_diff (LogLevel::Debug, in_variables, *frozen_func->prev_key );
1497
+ }
1494
1498
1495
1499
jit_log (LogLevel::Info,
1496
1500
" Recording (n_inputs=%u):" , in_variables.variables .size ());
@@ -1789,16 +1793,6 @@ nb::object FrozenFunction::operator()(nb::args args, nb::kwargs kwargs) {
1789
1793
}
1790
1794
1791
1795
if (it == this ->recordings .end ()) {
1792
- #ifndef NDEBUG
1793
- if (this ->recordings .size () >= 1 )
1794
- log_diff (LogLevel::Debug, *in_variables, *prev_key);
1795
- #else
1796
- if (this ->recordings .size () >= 1 &&
1797
- recording_counter + 1 > warn_recording_count) {
1798
- log_diff (LogLevel::Warn, *in_variables, *prev_key);
1799
- }
1800
- #endif
1801
-
1802
1796
{
1803
1797
// TODO: single traverse
1804
1798
ADScopeContext ad_scope (drjit::ADScope::Resume, 0 , nullptr , 0 ,
0 commit comments