v0.8.7: Replace periodic ResyncInterval with Kahan compensated summation

Comprehensive refactor across all indicators replacing the periodic
ResyncInterval-based drift correction (every 1000 ticks recalculate
from scratch) with Kahan compensated summation for running sums.

Key changes:
- Remove ResyncInterval constants and TickCount fields from all State records
- Add Kahan compensation fields (SumComp, SumSqComp, etc.) to State records
- Replace naive sum += val - removed with Kahan delta pattern
- Remove Resync()/RecalculateSum() methods that did O(N) recalculation
- Update batch/SIMD paths to use Kahan compensation instead of resync loops
- IIR filters (EMA, REMA, RGMA) simplified: inherently self-correcting
- Version bump to 0.8.7
- Build system: README version stamping via Directory.Build.props
- Minor doc/test tolerance adjustments for new numerical characteristics

Affected modules: channels, core, cycles, dynamics, errors, momentum,
oscillators, statistics, trends_FIR, trends_IIR, volatility, volume
This commit is contained in:
Miha Kralj
2026-03-13 22:01:31 -07:00
parent c75135ab14
commit 67ad6f0cba
79 changed files with 2923 additions and 2495 deletions
+14
View File
@@ -44,6 +44,20 @@
<ErrorLog>$(SarifOutputDir)/$(MSBuildProjectName).sarif,version=2.1</ErrorLog>
</PropertyGroup>
<!-- Stamp lib/VERSION into README.md replacing the <version> placeholder -->
<Target Name="StampReadmeVersion" BeforeTargets="CoreCompile"
Condition="Exists('$(QtaVersionFile)') AND Exists('$(MSBuildThisFileDirectory)README.md')">
<PropertyGroup>
<ReadmeFile>$(MSBuildThisFileDirectory)README.md</ReadmeFile>
</PropertyGroup>
<Exec Command="pwsh -NoProfile -Command &quot;(Get-Content '$(ReadmeFile)' -Raw) -replace '# QuanTAlib .*','# QuanTAlib $(QtaVersion)' | Set-Content '$(ReadmeFile)' -NoNewline&quot;"
Condition="$([MSBuild]::IsOSPlatform('Windows'))"
IgnoreExitCode="true" />
<Exec Command="sed -i 's/# QuanTAlib .*/# QuanTAlib $(QtaVersion)/' '$(ReadmeFile)'"
Condition="!$([MSBuild]::IsOSPlatform('Windows'))"
IgnoreExitCode="true" />
</Target>
<Target Name="CreateSarifDir" BeforeTargets="CoreCompile">
<MakeDir Directories="$(SarifOutputDir)" />
<Message Importance="High" Text="SARIF output directory: $(SarifOutputDir)" />