Skip to content

fix(ixxat): preserve controller start epoch and clock metadata - #2118

Open
timothyanderson096-ocdealcheck wants to merge 2 commits into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/2103-ixxat-epoch-start-ticks
Open

timothyanderson096-ocdealcheck wants to merge 2 commits into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/2103-ixxat-epoch-start-ticks

Conversation

@timothyanderson096-ocdealcheck

@timothyanderson096-ocdealcheck timothyanderson096-ocdealcheck commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

Correct the controller-start epoch midpoint in both IXXAT backends. Retain START ticks and TIMEOVR metadata during the existing bounded startup drain; process clock metadata in nonblocking FD reads; and keep ERROR/TIMEOVR messages out of the FD START branch.

Related Issues / Pull Requests

Closes #2103. Thanks to @MelansonTech for the hardware report and arithmetic/dispatch diagnosis. Open #1611 is a broader VCI4 replacement that still returns relative timestamps; its discussion and linked MattWoodhead#1 discussion were inspected. #1901 changes bus-state naming, not clock conversion. This patch repairs the current legacy backends.

The VCI C-API manual v1.5, printed pp.97–99, describes START-relative ticks, TIMEOVR wrap counts in dwMsgId and undefined TIMEOVR data bytes. Tests use the repository's actual CANMSG/CANMSG2 ctypes structures with mocked VCI calls.

Type of Change

  • Bug fix

Checklist

  • Contribution guide followed.
  • Regression tests and news fragment added.
  • All checks and tests pass (tox).

Additional Notes

Current validation — 12 November 2026 (Brisbane), commit 7d3e01c6a193464af268e393b1eb8546791362d2:

  • Consolidated the parameterized timestamp regressions in test/test_interface_ixxat.py; removed test/test_ixxat_timestamps.py. Both classic CAN and CAN FD remain covered.
  • Linux / CPython 3.12.14: both existing IXXAT modules collected 22 passed, 7 hardware-dependent skips, matching the pre-move cases. The moved fixtures, helpers and test-function ASTs are identical. Driver code and changelog are unchanged by this follow-up.
  • Black's project-wide check and configured Ruff checks pass. The final edited test file was checked again after formatting. Full tox, type/docs and OS/runtime matrices were not rerun locally for this test-only relocation; CI remains separate.

Earlier bug-fix validation:

Validation recorded on 25 October 2026, CPython 3.13.16 / Linux:

  • Same final 22-case file on original production code: 13 failures, 9 passing controls. Final source: 22 passed, independently rerun and rerun in the unchanged five-fix refresh.
  • Covers epoch midpoint, startup START/wrap metadata, blocking/nonblocking receive, rollover, unrelated INFO, ERROR dispatch, payload/FD/BRS flags and frame spacing. Missing START preserves the existing zero-offset fallback.
  • Configured lint, five static mypy targets and strict Sphinx HTML/doctests pass. Mypy excludes IXXAT/tests and Pylint's configured component list excludes IXXAT; these results do not imply direct static coverage of all changed code or five executed runtimes.
  • Full suite: 526 passed, 29 passing subtests, 97 skipped, 28 failed. All 28 failure identities equal unchanged-base multicast IPv4/IPv6 initialization failures (errno 19). One previously skipped mocked IXXAT shutdown test runs under the portable import scaffold. The all-tests checkbox remains unchecked.

On 27 October, public head 70c558ce3faa31bcdb4bf5b54797dfc5fa9881be, tree b051d7b935d33c0b0e4e894ddcdaccbbbc1089c4, was restored exactly from tested clean b12e285091cc13b6d4b2280527ad38c4d60d7098 on unchanged main b4f82ab. Original/refresh archive hashes, original/final XML, independent review and identical full-suite failure sets were checked. Tests were not rerun during publication.

Linux software tests do not establish native Windows VCI/physical-adapter behavior, other runtime/OS matrices or exact epoch accuracy beyond the midpoint estimate. Startup data discard and its bounded drain remain; external controller restarts are not recalibrated. The import scaffold supplies HRESULT only when absent, preserving the native Windows definition.

Prepared with AI assistance and independent inspection.

Timothy Anderson — Spotted Ridge Engineering / OC Labs
Independent software verification · GDN (Global Decision Network)
timothyanderson096@gmail.com · Engineering evidence

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T00:28:20.587228Z
We couldn’t complete this review. Comment @codex review to try again.
70c558c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@timothyanderson096-ocdealcheck

Copy link
Copy Markdown
Contributor Author

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/test_ixxat_timestamps.py Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are two ixxat test files already, no need for a third one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved the parameterized timestamp regressions into test/test_interface_ixxat.py and removed the third test file in 7d3e01c. Both classic CAN and CAN FD cases are preserved.

Focused checks on Linux / CPython 3.12.14: 22 passed, 7 existing hardware-dependent skips. The moved fixtures, helpers and assertions are unchanged; Black and the configured Ruff checks pass.

Timothy Anderson — Spotted Ridge Engineering / OC Labs · GDN
timothyanderson096@gmail.com

Move the parameterized classic CAN and CAN FD clock regressions into the existing IXXAT interface test module and remove the separate timestamp test file.
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.

IXXAT: timestamps read 1.5 x wall time plus adapter uptime (misplaced parenthesis in _timeoffset; start tick never captured in vcinpl2)

2 participants