Title: metrics: negative byte counts from 32-bit wrap of 64-bit counters and counter resets · Issue #353 · jangala-dev/devicecode-lua · GitHub
Open Graph Title: metrics: negative byte counts from 32-bit wrap of 64-bit counters and counter resets · Issue #353 · jangala-dev/devicecode-lua
X Title: metrics: negative byte counts from 32-bit wrap of 64-bit counters and counter resets · Issue #353 · jangala-dev/devicecode-lua
Description: Summary Telemetry shows negative byte counts. Samos (BB7ZJW5MWK2TFJ) showed −2.0 GB of Wi-Fi on 17 Sep, and −5.35 GB across 7 LTE samples between 21 Sep and 11 Oct. Download graphs therefore under-read. Cause 32-bit wrap: fix_underflow s...
Open Graph Description: Summary Telemetry shows negative byte counts. Samos (BB7ZJW5MWK2TFJ) showed −2.0 GB of Wi-Fi on 17 Sep, and −5.35 GB across 7 LTE samples between 21 Sep and 11 Oct. Download graphs therefore under-...
X Description: Summary Telemetry shows negative byte counts. Samos (BB7ZJW5MWK2TFJ) showed −2.0 GB of Wi-Fi on 17 Sep, and −5.35 GB across 7 LTE samples between 21 Sep and 11 Oct. Download graphs therefore under-...
Opengraph URL: https://github.com/jangala-dev/devicecode-lua/issues/353
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"metrics: negative byte counts from 32-bit wrap of 64-bit counters and counter resets","articleBody":"## Summary\n\nTelemetry shows negative byte counts. Samos (BB7ZJW5MWK2TFJ) showed −2.0 GB of Wi-Fi on 17 Sep, and −5.35 GB across 7 LTE samples between 21 Sep and 11 Oct. Download graphs therefore under-read.\n\n## Cause\n\n- **32-bit wrap:** `fix_underflow` subtracts 2^32 from any value over INT32_MAX ([radio.lua#L43-L48](https://github.com/jangala-dev/devicecode-lua/blob/a9691b9e2e6d43bf8631b0ab08bdbbe14fa6674b/src/services/hal/drivers/radio.lua#L43-L48)). It is also applied to per-station `tx_bytes`/`rx_bytes` ([radio.lua#L407-L414](https://github.com/jangala-dev/devicecode-lua/blob/a9691b9e2e6d43bf8631b0ab08bdbbe14fa6674b/src/services/hal/drivers/radio.lua#L407-L414)), which are 64-bit, so any counter past 2 GiB goes negative.\n- **No reset handling:** `DeltaValue:run` returns `value - last_val` without handling a counter reset ([processing.lua#L201-L211](https://github.com/jangala-dev/devicecode-lua/blob/a9691b9e2e6d43bf8631b0ab08bdbbe14fa6674b/src/services/metrics/processing.lua#L201-L211)). After a `wifi reload` or interface restart, the next delta is minus the old total. This predates v0.11, but v0.11 reloads more often.\n\n## Fix\n\n- Apply `fix_underflow` only to signed 32-bit fields (signal, noise, txpower, channel).\n- In `DeltaValue`, treat a value lower than the last one as a reset: report the new value, or skip that sample.\n","author":{"url":"https://github.com/cpunt","@type":"Person","name":"cpunt"},"datePublished":"2026-10-29T15:03:59Z","url":"https://github.com/jangala-dev/devicecode-lua/issues/353"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:83855a1e-4d38-8e03-6152-978a2d19275d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C02A:B0154:160326E:1D27B2A:6AF89FDD |
| html-safe-nonce | 05d302fdc51fab24b13a47e646548b0dee498dc65f837d9159716af909f195f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDJBOkIwMTU0OjE2MDMyNkU6MUQyN0IyQTo2QUY4OUZERCIsInZpc2l0b3JfaWQiOiI4MTA4NjI4NjEwMDA1OTAxMjc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1c4fa28325adbda8691ddae5503c05176931c50dceb3ddbaa5cf2a1e7eab2063 |
| hovercard-subject-tag | issue:6102499231 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/jangala-dev/devicecode-lua/353/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00a585715e2878ab46d0ca62951348b03f8216bf61942da3b5e5c3c461e89c3b/jangala-dev/devicecode-lua/issues/353 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00a585715e2878ab46d0ca62951348b03f8216bf61942da3b5e5c3c461e89c3b/jangala-dev/devicecode-lua/issues/353 |
| og:image:alt | Summary Telemetry shows negative byte counts. Samos (BB7ZJW5MWK2TFJ) showed −2.0 GB of Wi-Fi on 17 Sep, and −5.35 GB across 7 LTE samples between 21 Sep and 11 Oct. Download graphs therefore under-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cpunt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/jangala-dev/devicecode-lua git https://github.com/jangala-dev/devicecode-lua.git |
| octolytics-dimension-user_id | 44901909 |
| octolytics-dimension-user_login | jangala-dev |
| octolytics-dimension-repository_id | 814022112 |
| octolytics-dimension-repository_nwo | jangala-dev/devicecode-lua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 814022112 |
| octolytics-dimension-repository_network_root_nwo | jangala-dev/devicecode-lua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width