Skip to content

fix(pcan): preserve Linux epoch timestamps without boot offset - #2119

Open
timothyanderson096-ocdealcheck wants to merge 1 commit into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/2108-pcan-linux-epoch
Open

timothyanderson096-ocdealcheck wants to merge 1 commit into
hardbyte:mainfrom
timothyanderson096-ocdealcheck:fix/2108-pcan-linux-epoch

Conversation

@timothyanderson096-ocdealcheck

Copy link
Copy Markdown

Summary of Changes

Preserve PCAN-Basic's Linux Unix-epoch timestamps for classic CAN and CAN FD. Select a zero boot offset on Linux, bypassing the irrelevant uptime import/lookup/warning; retain the complete existing conversion and fallback on other platforms. Add platform/clock controls, documentation and a news fragment.

Related Issues / Pull Requests

Closes #2108. Thanks to @rodrigocarbonell-creator for the report and clock-domain diagnosis. PEAK's timestamp documentation distinguishes Windows system-start timestamps from Linux epoch timestamps. The original preparation also inspected the Linux 5.0.1.8 source/addendum; no vendor code is redistributed. Current #1901 changes bus-state names, not this clock conversion.

Type of Change

  • Bug fix
  • Documentation update

Checklist

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

Additional Notes

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

  • Exact final timestamp cases on original backend: six Linux failures, 12 non-Linux controls pass. The six are two numeric-offset errors, two misleading warnings and two unnecessary uptime calls.
  • Final 18 timestamp cases pass; full PCAN module 66 tests plus 24 subtests pass, also rerun in the unchanged five-fix refresh. Independent inspection reran the 18 timestamp cases.
  • Tests isolate the imported backend namespace and mock Linux/Windows/macOS flags, classic/FD frames and available/missing/unknown uptime. Four timestamps per case check epoch/elapsed clocks, spacing and classic overflow boundaries; payload/ID/DLC/FD/BRS controls remain. Native event handles are disabled in these clock tests.
  • Configured lint, five static mypy targets and strict Sphinx HTML/doctests pass. PCAN/tests are excluded from project mypy coverage; static version targets are not executed runtime matrices.
  • Full suite: 521 passed, 29 passing subtests, 98 skipped, 28 failed. All 28 failure identities equal the unchanged-base multicast IPv4/IPv6 initialization failures, errno 19. The all-tests checkbox remains unchecked.

On 27 October, public head 6bf8c074a6ba919d5c9b5833c9386be74c479690, tree d5825a6c0228039dff16561b4178409eea9fb114, was restored exactly from clean tested 19b565f877c76fbc2853aa3dc2814b0b1dd4b399 on unchanged main b4f82ab. Original/refresh archive hashes, raw XML, source identities and independent review were checked. Tests were not rerun during publication.

No physical PCAN adapter/driver execution, native Windows/macOS, SocketCAN vcan or complete interpreter matrix is validated. This preserves existing non-Linux semantics; it does not newly establish those platforms' hardware clock behavior.

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-27T04:58:55.118397Z
We couldn’t complete this review. Comment @codex review to try again.
6bf8c07 PR opened
ℹ️ 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.

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.

PcanBus adds boottimeEpoch to PCAN-Basic timestamps that are already UTC epoch on Linux

1 participant