Skip to content

Comments

Load entire dataset for correlation validation tests#100

Merged
drewsonne merged 11 commits intofix/winal-radix-correctionfrom
copilot/sub-pr-94-again
Jan 2, 2026
Merged

Load entire dataset for correlation validation tests#100
drewsonne merged 11 commits intofix/winal-radix-correctionfrom
copilot/sub-pr-94-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

Addresses review feedback to remove all filtering logic and load the complete correlation dataset for comprehensive validation.

Changes

  • Removed filtering logic: All correlation tests now process the entire dataset

    • Direct source correlations: Tests all 40+ entries (previously limited to 5)
    • JSON dataset correlations: Tests all 80+ entries (previously limited to 10)
    • Total: 120+ correlation tests for comprehensive validation
  • Simplified implementation: Removed helper functions and environment variable support

    • No conditional logic or sample size configuration
    • Direct loading of full datasets from test data loader

Testing

All correlation validation tests now run against the complete dataset, providing comprehensive coverage of the correlation data.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Note

  • Load full datasets in tests: src/__tests__/lc/western/western.spec.ts now processes all direct-source and JSON correlations; removed skip logic and sampling; uses per-entry correlation constants via getCorrelationConstant(correlation.correlation_jdn) instead of hardcoded GMT.
  • Gregorian parsing fix: src/factory/gregorian.ts updates BCE handling to astronomical year numbering (1 BCE -> year 0) and compares against the original input year, improving correctness around BCE dates and threshold calculations.
  • String formatting change: src/lc/western/western.ts toString() no longer appends * on Julian/Gregorian threshold dates; expected strings in tests updated accordingly (e.g., 15/10/1582 CE).

Written by Cursor Bugbot for commit 2b247d3. This will update automatically on new commits. Configure here.

Copilot AI mentioned this pull request Jan 2, 2026
Copilot AI changed the title [WIP] Address feedback on fix/winal-radix-correction PR Add configurable TEST_SAMPLE_SIZE environment variable for test coverage control Jan 2, 2026
Copilot AI requested a review from drewsonne January 2, 2026 17:37
@drewsonne
Copy link
Owner

@copilot I want to change this. Let's not filter anything. Just load the whole file

Copy link
Contributor Author

Copilot AI commented Jan 2, 2026

@copilot I want to change this. Let's not filter anything. Just load the whole file

Removed all filtering logic. The tests now load and validate the entire dataset - all 40+ direct source correlations and 80+ JSON dataset correlations (120+ tests total instead of 15). Changes in commit 234d253.

Copilot AI changed the title Add configurable TEST_SAMPLE_SIZE environment variable for test coverage control Load entire dataset for correlation validation tests Jan 2, 2026
Copilot AI and others added 4 commits January 2, 2026 18:54
…age control

Co-authored-by: drewsonne <233054+drewsonne@users.noreply.github.com>
Co-authored-by: drewsonne <233054+drewsonne@users.noreply.github.com>
Co-authored-by: drewsonne <233054+drewsonne@users.noreply.github.com>
Co-authored-by: drewsonne <233054+drewsonne@users.noreply.github.com>
@drewsonne drewsonne force-pushed the copilot/sub-pr-94-again branch from 234d253 to e46cb0f Compare January 2, 2026 18:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes all filtering logic from correlation validation tests to enable comprehensive testing of the complete dataset. Previously, tests were limited to small samples (5 and 10 entries) for performance reasons, but now process all 120+ correlation entries. Additionally, the PR includes fixes to the Gregorian calendar offset table and adds diagnostic tests to investigate year boundary calculation issues.

  • Removed sample size limitations from correlation validation tests
  • Added refined offset boundaries in the Gregorian calendar date calculation
  • Added comprehensive diagnostic tests for investigating offset calculation issues

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/tests/lc/western/western.spec.ts Removed filtering and slicing logic to test complete correlation datasets
src/lc/western/gregorian.ts Added new offset boundary conditions for JDN ranges 1955908 and 1984764
src/tests/diagnostic-boundary.spec.ts Added diagnostic tests to investigate year boundary and offset calculation failures
src/tests/calculate-offsets.spec.ts Added tests to calculate and verify exact offset boundaries for failing test cases

return 5;
}
if (this.julianDay <= 2031864) {
return 2;
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The offset values are decreasing (5 → 2) as JDN increases, which is counterintuitive. Based on the diagnostic test comments in calculate-offsets.spec.ts line 78, this pattern 'doesn't make sense'. This suggests either incorrect boundary values or a fundamental issue with the offset calculation approach that needs investigation.

Suggested change
return 2;
return 6;

Copilot uses AI. Check for mistakes.
- Fixed BCE year conversion to use astronomical year numbering (1 BCE = year 0)
- Corrected verification logic in GregorianFactory.parse() for BCE dates
- Removed asterisk suffix from toString() for threshold dates (Oct 4/15, 1582)
- Cleaned up test data to remove asterisk markers from date strings
- Simplified Gregorian offset table to remove incorrect intermediate ranges
- All 466 tests now passing, including 5 previously failing edge cases
- Renamed correlation-validation.spec.ts.skip back to .spec.ts
- All comprehensive data validation tests now pass
- Tests validate JSON dataset structure, metadata, helper functions
- Adds 20 additional passing tests for data quality and structure
This temporary debugging file was used to investigate year boundary failures
that have now been fixed. No longer needed with all tests passing.
This diagnostic test was used to investigate year boundary failures
that have now been resolved. The actual functionality is covered by
western.spec.ts and correlation-validation.spec.ts.
This file was used to debug offset boundary calculations but only prints
diagnostic output without actual assertions. The functionality is fully
tested in western.spec.ts with proper assertions.
The variable held all Gregorian calendar dates from the dataset, not a sample.
Also updated the test suite description for clarity.
@drewsonne drewsonne marked this pull request as ready for review January 2, 2026 20:43
@drewsonne drewsonne merged commit 97f1cfe into fix/winal-radix-correction Jan 2, 2026
6 checks passed
@drewsonne drewsonne deleted the copilot/sub-pr-94-again branch January 2, 2026 20:43
@drewsonne drewsonne restored the copilot/sub-pr-94-again branch January 3, 2026 08:05
@drewsonne drewsonne deleted the copilot/sub-pr-94-again branch January 3, 2026 08:13
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.

2 participants