You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c5bb10e
Browse filesBrowse the repository at this point in the historyBrowse files
-`codacy-analysis analyze --files ... --output-format json`: exit status 0, 0 issues, 1 known Revive adapter error:
464
464
- Revive error: `Failed to run revive: findings is not iterable`.
465
465
466
+
### 2026-06-07 - C UDS Send AI Follow-up
467
+
468
+
- GitHub AI findings on `src/libnetdata/netipc/src/transport/posix/netipc_uds_send.c` reported:
469
+
- ambiguous `min_size` helper name.
470
+
- casts from `size_t` to `uint32_t` for payload length, chunk payload length, and total message length whose invariants were not explicit.
471
+
- ceil division using `(remaining + chunk_payload_budget - 1)`, which could overflow in the abstract.
472
+
- Local verification found one issue stronger than the GitHub wording:
473
+
-`src/libnetdata/netipc/src/transport/posix/netipc_uds.c:nipc_uds_header_payload_len()` only checked `SIZE_MAX` overflow on 32-bit builds and did not reject framed total message lengths above `UINT32_MAX` on 64-bit builds.
474
+
-`src/libnetdata/netipc/src/transport/windows/netipc_named_pipe.c:header_payload_len()` had the same helper shape, so the same contract issue existed in the Windows C transport.
475
+
- Implemented follow-up:
476
+
- renamed POSIX helper `min_size` to `min_of_size_t`.
477
+
- added assertions at the narrowing cast sites.
478
+
- changed POSIX and Windows C total-message helpers to reject `NIPC_HEADER_LEN + payload_len > UINT32_MAX`.
479
+
- changed POSIX and Windows C chunk-count calculation to `1 + ((remaining - 1) / chunk_payload_budget)` to avoid forming a potentially overflowing addition.
480
+
- changed chunk-budget checks from equality to `session->packet_size <= NIPC_HEADER_LEN` to avoid unsigned underflow if a malformed session reaches send.
481
+
- added POSIX C regression coverage for underflow chunk budget and oversized framed total-message length.
482
+
- Benchmark runner follow-up:
483
+
- Full Windows benchmark startup failed before running benchmarks because `tests/run-windows-bench.sh` passed `/mingw64/bin/gcc` and `/mingw64/bin/g++` to CMake.
484
+
- CMake 4.3.0 in the current MSYS environment translated those to `C:/msys64/mingw64/bin/gcc` and rejected them as non-existing full paths.
485
+
- Updated the runner to pass Windows-style `.exe` paths from `cygpath -m`, for example `C:/msys64/mingw64/bin/gcc.exe`.
486
+
- POSIX benchmark failure root cause:
487
+
- Full POSIX benchmark initially failed deterministically on `uds-batch-ping-pong rust->c @ max`.
488
+
- Manual focused repro failed before processing item zero.
489
+
- Root cause: the Rust POSIX batch benchmark client/server configs raised batch item counts and response payload size, but did not raise request payload size. Large 2..1000 item batch requests could exceed the negotiated request payload limit before reaching the C server.
490
+
- Fixed `bench/drivers/rust/src/main.rs` so POSIX Rust batch client and server configs set all four batch/request/response limits consistently.
491
+
- Go benchmark determinism follow-up:
492
+
- Local `go doc math/rand.Seed` for the installed Go toolchain says package-level random state is seeded randomly at startup when `Seed` is not called, and since Go 1.24 package-level `Seed` is a no-op.
493
+
- C and Rust benchmark batch-size streams were deterministic xorshift32 with seed `12345`; Go was not.
494
+
- Replaced Go package-global `math/rand` batch sizing in POSIX and Windows benchmark drivers with a local xorshift32 sequence matching the C/Rust seed.
- The Windows runner previously compared `target_rps` directly to prior max item throughput when deciding whether a fixed-rate row was oversubscribed.
498
+
- Added fixed-rate target throughput calculation for batch rows using the 2..1000 batch-size midpoint, so oversubscription classification compares item-throughput to item-throughput.
499
+
- Moved oversubscription handling before stable-ratio failure handling so an intentionally overloaded fixed-rate row is classified consistently.
500
+
- Windows benchmark timeout evidence:
501
+
- First fresh full Windows run reached `shm-ping-pong c->go @ max` and recorded one hard failure: the C client was killed by the runner outer `timeout` with exit 124 while the Go server had printed `READY`.
502
+
- The C client produced no stderr because the outer timeout was shorter than the benchmark client's own 30s SHM receive timeout.
503
+
- Fixed `tests/run-windows-bench.sh` by adding `NIPC_BENCH_CLIENT_TIMEOUT_GRACE_SEC`, default `35`, and using `duration + CLIENT_TIMEOUT_GRACE_SEC` for client process timeouts.
504
+
- Stopped the invalid full Windows run and cleaned up only the exact remote benchmark PIDs tied to `/tmp/plugin-ipc-bench-full-results-fixed4` and `/tmp/netipc-bench-88189`.
505
+
- Focused Win11 diagnostic for `shm-ping-pong c->go @ max` with diagnostics enabled passed: throughput `2714891/s`, p50 `3.700us`, p95 `8.900us`, p99 `16.200us`, stable ratio `1.017852`, no warnings.
506
+
- A fresh full Windows benchmark rerun with the improved timeout (`fixed5`) was stopped after the first row failed the stability policy, not correctness: `np-ping-pong c->c @ max` samples were `75452`, `74311`, `52814`, `66071`, and `51296`, with no client/server errors.
507
+
- Focused Win11 diagnostic for `np-ping-pong c->c @ max` with the same default durations passed: throughput `77680/s`, p50 `13.200us`, p95 `41.800us`, p99 `82.600us`, stable ratio `1.093959`, no warnings.
508
+
- The final full Win11 benchmark rerun with diagnostics enabled passed with exit status 0:
- hard failure scan: no `client failed`, `server failed`, `did not stop`, `error`, `One or more Windows benchmark scenarios failed`, or `Diagnostic rerun failed` matches.
512
+
- one stability-only row was recovered by a successful diagnostic rerun: `np-batch-ping-pong go->go @ 10000/s`, first attempt stable ratio `1.849425`, diagnostic stable ratio `1.000165`, recovered median throughput `5040434/s`.
513
+
- remaining warnings were raw repeated-throughput outliers or oversubscribed fixed-rate rows kept by the benchmark policy, with stable trimmed cores or intentional overload evidence.
514
+
- Vendor script follow-up:
515
+
-`vendor-to-netdata.sh` still had a hard-coded C file list from before the C source splits.
516
+
- Updated it to rsync the full vendored C include tree and C source tree, preserving Netdata-specific root wrapper files outside those synced subtrees.
517
+
- This is required before updating the NetIPC vendored copy in `~/src/netdata-ktsaou.git`; otherwise split C files would be silently missed.
- Local targeted Codacy Analysis CLI scan with JSON output on the changed files: 0 issues, 1 known Revive adapter invocation error (`findings is not iterable`); latest output `/tmp/plugin-ipc-codacy-final6.json`.
529
+
- Full POSIX benchmark rerun: 298 CSV lines, no warnings or failures, output at `/tmp/plugin-ipc-bench-full-posix-final/benchmarks-posix.csv`.
530
+
- Full Win11 benchmark rerun: 202 CSV lines, no hard failures, output at `/tmp/plugin-ipc-bench-full-results-final2/benchmarks-windows.csv`.
531
+
532
+
### 2026-06-07 - Netdata Re-vendor Plan
533
+
534
+
The next repository step is to update the vendored NetIPC copy in `~/src/netdata-ktsaou.git` after this SDK commit is pushed.
535
+
536
+
Plan:
537
+
538
+
1. Read `~/src/netdata-ktsaou.git/AGENTS.md` and any active Netdata SOW instructions before editing that repository.
539
+
2. Create or switch to a dedicated Netdata branch for the vendor update.
540
+
3. Run `./vendor-to-netdata.sh ~/src/netdata-ktsaou.git` from this repository.
541
+
4. Run `./diff-netdata-vendor.sh ~/src/netdata-ktsaou.git --unified` and inspect the result so only expected vendored NetIPC files changed.
542
+
5. If the script reports required Go import rewrites, run the exact rewrite command in the Netdata repository and re-check the diff.
543
+
6. Update Netdata build integration if the split C source files require changed source lists.
544
+
7. Validate Netdata build/tests for the vendored NetIPC surface, including Windows compile/unit validation if the Netdata workflow exposes it locally.
545
+
8. Commit only explicit Netdata vendor/update files, push the branch, and open a PR against Netdata.
546
+
466
547
## Validation
467
548
468
549
Acceptance criteria evidence:
469
550
470
-
- Pending.
551
+
- Codacy global scope correction was implemented earlier in this SOW and pushed.
552
+
- The C UDS send AI finding was addressed in `src/libnetdata/netipc/src/transport/posix/netipc_uds_send.c`:
553
+
- helper renamed to `min_of_size_t`.
554
+
- narrowing casts now have explicit assertions and safety-contract comments.
555
+
- send chunk count no longer forms `(remaining + chunk_payload_budget - 1)`.
556
+
- Same-pattern C transport issue was addressed in `src/libnetdata/netipc/src/transport/windows/netipc_named_pipe.c`.
557
+
- Vendor script now copies the full vendored C include/source subtrees so split C files are not missed.
-`codacy-analysis analyze --files ... --output-format json`: 0 issues; known local Revive adapter invocation error remains.
475
569
476
570
Real-use evidence:
477
571
478
-
- Pending.
572
+
- Full POSIX benchmark: 298 CSV lines, no warnings or failures, artifact `/tmp/plugin-ipc-bench-full-posix-final/benchmarks-posix.csv`.
573
+
- Full Win11 benchmark: 202 CSV lines, exit status 0, no hard failure scan matches, artifact `/tmp/plugin-ipc-bench-full-results-final2/benchmarks-windows.csv`.
574
+
- Win11 diagnostic rerun recovered one stability-only row and published the diagnostic row.
479
575
480
576
Reviewer findings:
481
577
482
-
- No external reviewer used yet.
578
+
- GitHub AI findings for `netipc_uds_send.c` were manually verified and addressed.
579
+
- No external AI reviewer was used for this increment.
483
580
484
581
Same-failure scan:
485
582
486
-
- Pending.
583
+
- Same C total-message-width helper pattern was found and fixed in the Windows named-pipe transport.
584
+
- Same chunk-count overflow-prone ceil pattern was found and fixed in POSIX C, Windows C, POSIX Rust, Windows Rust, POSIX Go, and Windows Go transport paths.
585
+
- Same benchmark batch sizing nondeterminism pattern was found and fixed in POSIX and Windows Go benchmark drivers.
487
586
488
587
Sensitive data gate:
489
588
490
-
- Pending final scan.
589
+
-`.env` was not read or committed.
590
+
- SOW evidence records local artifact paths, command names, and sanitized tool output only; no secrets or customer data were written.
491
591
492
592
Artifact maintenance gate:
493
593
494
-
- AGENTS.md: pending.
495
-
- Runtime project skills: pending.
496
-
- Specs: pending.
497
-
- End-user/operator docs: pending.
498
-
- End-user/operator skills: pending.
499
-
- SOW lifecycle: pending.
594
+
- AGENTS.md: no workflow or guardrail change needed.
595
+
- Runtime project skills: no reusable project workflow changed.
596
+
- Specs: no protocol/API spec update needed; wire fields were already `u32`, and the implementation now enforces that existing wire contract consistently.
597
+
- End-user/operator docs: no public usage behavior changed.
598
+
- End-user/operator skills: no exported/operator workflow changed.
599
+
- SOW lifecycle: SOW remains `in-progress`; this increment records validation and the Netdata re-vendor plan.
500
600
501
601
Specs update:
502
602
503
-
-Pending.
603
+
-No spec update needed for this increment; the implementation now matches the existing `u32` wire-field constraints.
504
604
505
605
Project skills update:
506
606
507
-
-Pending.
607
+
-No project skill update needed; no reusable repo workflow changed beyond the current SOW evidence.
508
608
509
609
End-user/operator docs update:
510
610
511
-
-Pending.
611
+
-No end-user/operator docs update needed; public API and documented usage did not change.
512
612
513
613
End-user/operator skills update:
514
614
515
-
-Pending.
615
+
-No end-user/operator skill update needed.
516
616
517
617
Lessons:
518
618
519
-
- Pending.
619
+
- Benchmark runners must distinguish correctness failures from stability-only noise and must preserve first-attempt evidence before any diagnostic recovery.
620
+
- Vendor scripts should copy source subtrees after source-file organization splits; hard-coded file lists go stale quickly.
520
621
521
622
Follow-up mapping:
522
623
523
-
-Pending.
624
+
-Netdata re-vendor work is planned in this SOW and will be performed after the SDK commit is pushed.
0 commit comments