Skip to content

Fix Intel cache unit and V4L2 IPU6 camera list - #309

Merged
l1a merged 1 commit into
mainfrom
fix/intel-cache-and-cameras
Oct 30, 2026
Merged

l1a merged 1 commit into
mainfrom
fix/intel-cache-and-cameras

Conversation

@l1a

@l1a l1a commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fix duplicate "M" unit in fractional MiB CPU cache sizes (L2: 1.25MM -> L2: 1.25M):
    • format_cpu_cache_entries in crates/sysinfo/src/fetch.rs formatted fractional MiB cache sizes (kb >= 1024 && !kb.is_multiple_of(1024)) with format!("{:.2}M", kb as f64 / 1024.0) before calling .trim_end_matches('0').trim_end_matches('.'), and then appended + "M". Because AMD and Apple CPUs have power-of-2 L2 cache sizes (512K, 1024K, 2048K), they take the exact-multiple branch; Intel Golden Cove / Raptor Cove / Lion Cove P-cores have 1280K (1.25 MiB) or 2560K (2.5 MiB) L2 caches and hit the fractional branch.
    • Format the numeric value first ("{:.2}"), strip trailing zeros/dot, and append "M" once (1280K -> "1.25M", 1536K -> "1.5M").
  • Filter V4L2 ISP/CSI pipeline nodes and format MIPI I2C camera sensor descriptions (Camera:):
    • On Intel MIPI IPU6 laptops (rabban, Dell XPS 13 Plus 9320, 12th Gen Intel Core i7-1260P), /sys/class/video4linux exposes 32 ISP DMA multiplex capture queues (Intel IPU6 ISYS Capture 0..31), 4 CSI-2 receiver subdevices (Intel IPU6 CSI2 0..3), and 1 MEI CSI bridge (Intel IVSC CSI) alongside the physical I2C camera sensor (ov01a10 17-0036).
    • Exclude ISP/CSI pipeline plumbing (isys capture, csi2, ivsc csi, ipu3-) in is_real_camera(), expand v4l2_i2c_subdev_set_name strings ("<model> <bus>-<4-hex-addr>") into "<Vendor> <MODEL>" (OmniVision OV01A10, Sony IMX258, SK Hynix HI556, etc.), append (Front) / (Back) when device/physical_location/panel is front or back via collect_v4l2_cameras_with_panel(), and sort /sys/class/video4linux directory entries deterministically in Linux detect_camera().
  • Version & docs:
    • Bump retch-cli to 0.20.34 and retch-sysinfo to 0.1.99, update Cargo.lock, regenerate docs/retch.1, and update NOTES.md.

Test Plan

  • Verify cargo test --workspace passes (including test_format_cpu_cache_entries_fractional_mib, test_is_real_camera, test_clean_camera_name, test_collect_v4l2_cameras_filters_intel_ipu6_pipeline, and test_collect_v4l2_cameras_deduplicates_and_cleans_uvc_nodes, verified by mutation).
  • Verify just check passes.
  • Verify live retch --ascii-logo --color never output on rabban (12th Gen Intel Core i7-1260P, Fedora 44) shows CPU Cache: L1d: 48K, L1i: 32K, L2: 1.25M, L3: 18M and Camera: OmniVision OV01A10 (Front).
  • Verify CI checks pass on the PR.

- Fix `format_cpu_cache_entries` in `crates/sysinfo/src/fetch.rs` where
  fractional MiB cache sizes (`kb >= 1024 && !kb.is_multiple_of(1024)`)
  formatted `"{:.2}M"` before `.trim_end_matches('0')` and then appended
  `+ "M"`, producing `"1.25MM"` on Intel Golden Cove / Raptor Cove / Lion
  Cove P-cores (`1280` KB = 1.25 MiB).
- Filter V4L2 ISP DMA capture queues (`Intel IPU6 ISYS Capture 0..31`),
  CSI-2 receivers (`Intel IPU6 CSI2 0..3`), and MEI CSI bridges
  (`Intel IVSC CSI`, `ipu3-*`) in `is_real_camera()`, expand V4L2 I2C
  sensor names (`"<model> <bus>-<4-hex-addr>"`) to `"<Vendor> <MODEL>"`
  (`"ov01a10 17-0036"` -> `"OmniVision OV01A10"`), append panel location
  (`(Front)` / `(Back)`) from `device/physical_location/panel`, and sort
  `/sys/class/video4linux` entries deterministically in `detect_camera()`.
- Bump `retch-cli` to 0.20.34 and `retch-sysinfo` to 0.1.99, regenerate
  `docs/retch.1`, and update `NOTES.md`.

Assisted-By: Claude Opus 4.6
@l1a
l1a force-pushed the fix/intel-cache-and-cameras branch from d38e54e to a09e218 Compare October 30, 2026 21:32

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a09e218. Configure here.

&& !name_lower.contains("isys capture")
&& !name_lower.contains(" csi2")
&& !name_lower.contains("ivsc csi")
&& !name_lower.starts_with("ipu3-")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IPU6 BE SOC nodes unfiltered

Medium Severity

The new is_real_camera denylist matches isys capture, csi2, ivsc csi, and ipu3-, but out-of-tree IPU6 drivers register pipeline video nodes named Intel IPU6 BE SOC capture. Those names miss every substring, so they still appear as cameras on Ubuntu OEM IPU6 systems.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a09e218. Configure here.

@l1a
l1a merged commit b1b47a1 into main Oct 30, 2026
27 checks passed
@l1a
l1a deleted the fix/intel-cache-and-cameras branch October 30, 2026 22:25
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.

1 participant