@@ -56,6 +56,8 @@ const TRACE_FISTA_TOL = 1e-4;
5656/** Per-subset kernel estimation solver parameters. */
5757const KERNEL_FISTA_MAX_ITERS = 200 ;
5858const KERNEL_FISTA_TOL = 1e-4 ;
59+ /** TV-L1 smoothness penalty for free-form kernel estimation. */
60+ const KERNEL_SMOOTH_LAMBDA = 0 ;
5961
6062let pool : WorkerPool < CaDeconPoolJob > | null = null ;
6163let nextJobId = 0 ;
@@ -241,6 +243,7 @@ function dispatchKernelJobs(
241243 maxIters : KERNEL_FISTA_MAX_ITERS ,
242244 tol : KERNEL_FISTA_TOL ,
243245 refine : true ,
246+ smoothLambda : KERNEL_SMOOTH_LAMBDA ,
244247 warmKernel,
245248 onComplete ( result : KernelResult ) {
246249 kernelResults . push ( result ) ;
@@ -530,7 +533,7 @@ export async function startRun(): Promise<void> {
530533 } ) ) ,
531534 } ) ;
532535
533- // Step 4: Best-residual tracking & early stop
536+ // Step 4: Best-residual tracking & early stop (DISABLED)
534537 //
535538 // TODO: The current stopping criterion uses the bi-exponential fit residual
536539 // (||h_free - β·template||²), which measures kernel shape mismatch. This
@@ -540,6 +543,10 @@ export async function startRun(): Promise<void> {
540543 // the model explains the data. That's more expensive to compute but would
541544 // be a stronger signal for when the kernel has overshot.
542545 //
546+ // Disabled: with damped tau updates the residual-patience early stop fires
547+ // too aggressively before the damped parameters have had time to settle.
548+ // Re-enable once a better stopping metric is implemented.
549+ //
543550 if ( medResidual < bestResidual ) {
544551 bestResidual = medResidual ;
545552 bestTauR = tauR ;
@@ -550,14 +557,6 @@ export async function startRun(): Promise<void> {
550557 residualIncreaseCount ++ ;
551558 }
552559
553- // Early stop: if residual has risen for RESIDUAL_PATIENCE consecutive
554- // iterations, the optimizer has overshot. The post-loop revert below will
555- // restore the best-residual kernel parameters before finalization.
556- if ( residualIncreaseCount >= RESIDUAL_PATIENCE ) {
557- setConvergedAtIteration ( bestIteration ) ;
558- break ;
559- }
560-
561560 // Step 5: Convergence check (relative change in tau values)
562561 const relChangeTauR = Math . abs ( tauR - prevTauR ) / ( prevTauR + 1e-20 ) ;
563562 const relChangeTauD = Math . abs ( tauD - prevTauD ) / ( prevTauD + 1e-20 ) ;
0 commit comments