Faet/migrate back third party - #83
Merged
Merged
Conversation
visor 名留给用户的嵌入式线;PC GUI 框架迁去独立仓库 Cinux-GUI,改名切割。 C++ 命名空间 visor:: → cinux::gui::;主入口 cinux::gui::visor_pump → cinux::gui::pump(命名空间已带身份,去前缀);C ABI 全局前缀 visor_ → cgui_、 VISOR_ → CGUI_(C 结构体进不了命名空间,留短前缀 cgui_host/CGUI_PIX_*); 文件/目录 visor_* → cgui_*、visor/ → cgui/;test_visor_* → test_cgui_*。 adapter cinux_visor_host(_init) → cinux_host(_init)。 机械 6 步:visor::→cinux::gui:: / VISOR_→CGUI_ / visor_→cgui_ / pump 函数特殊 处理(perl 负向前瞻,文件名 cgui_pump.hpp 保留、函数 cgui_pump→pump)/ prose+ 目录路径 \bvisor\b→cgui / adapter 函数去冗余 cgui。命名空间声明 namespace visor 被 step5 误中为 namespace cgui,手工修回 namespace cinux::gui(4 文件)。 审计确认 cinux::gui 与内核现有 WindowManager/Window/Terminal/Event 零符号撞车。 验证:独立 cgui 构建(hosted 编译器)零 kernel include + harness ctest 绿 + 全量 build + run-kernel-test 928/0 + GUI 冒烟[cgui] adapter 初始化零 panic + test_host 49/49。全树零 visor 遗留。
…xOS F13 cgui core)
按「都命名空间了,别加前缀」把 cgui_/CGUI_ 全去掉: - 文件去前缀 + .h→.hpp(cgui_host.h→host.hpp 等),顺手修 swraseter→swraster 拼写。 - C ABI 进 cinux::gui 命名空间(Host/Frame/HostCore/HostDesktop/EventHeader/ PointerPayload/KeycodePayload),PixelFormat 改 enum class,事件常量改 k-前缀 constexpr;cgui_rect 并入已有 cinux::gui::Rect;去 extern "C"。 - MCU 砍掉:删 conf.hpp(profile/buffer-mode/NO_FPU 全是 MCU 机制),HostCore 去 enter/exit_sleep + next_deadline_ms,PixFmt 只留 XRGB/ARGB(PC 格式)。 - 目标 cgui_core→cinux-gui,harness exe→cinux-gui-smoke。 验证:独立构建(hosted 编译器,零 kernel include)零警告 -Wall -Wextra; cinux-gui-smoke ctest 1/1(null-host 安全 + idle-skip + dirty-flush + region 代数)。
Cinux 内核 event.hpp 已有 cinux::gui::EventType(MouseMove/Down…),核心的线事件 ABI 枚举同名会重定义。改核心的为 EventCode(内核无此名)。EventHeader.type 字段 跟随。仅 event.hpp + event_payload.hpp 注释;无 .cpp 引用。 独立构建+cinux-gui-smoke ctest 绿。
pump 的 Rect rects[kMaxDirtyRects](64 rects ~1KB)和 Region::subtract 的 Rect staged[kMaxRects*4](128 rects ~2KB)原在栈上;GUI composite 路径本就深, 叠 LAPIC timer 嵌套会把内核栈(16KB)撑爆(半绘帧花屏+#DF)。挪到堆(new[]/ delete[],单出口释放),帧从 1168/2112 降到 160/64。对标 Linux 8KB 栈纪律。
落地 2026-06-30 重启共识作为本仓单一事实源:现状(core 骨架已成,但 swraster 未接 pump,渲染仍走 host→wm.composite);战略(极致独立/Host ABI 唯一缝/CinuxOS 只剩薄适配器/Linux 先跑底层 fbdev+evdev);第一刀(Probe-0 无头离屏→Probe-1 真 fbdev+evdev,前置必做=swraster 接进 pump §4c);里程碑树 P0-P7 + MCU 线;验证哲学(金帧+脏区断言+ASAN 自动,好看靠眼);两仓契约。
从 CinuxOS 改编(非照搬):验证 run-kernel-test→standalone ctest;命令 @docs/ROADMAP.md;架构不变量折进 CLAUDE.md(不搬内核专属的 DIRECTIVES/CODING-TASTE/QUALITY-GATES)。本仓至此独立可开发。纯文档/配置,未动源码。
5 份规范文档克隆自 CinuxOS 并修剪:DIRECTIVES/CODING-TASTE/QUALITY-GATES/prompts/CLAUDE.md。内核专属→GUI 不变量翻译(run-kernel-test→standalone ctest、ErrorOr/syscall 删、内核不变量换 Host ABI 7 条:host-neutral core / flush 模型 / region 不欠覆盖 / 单线程 SPSC / 纯整数 / #ifdef→CMake),通用规范逐字保留。docs/ROADMAP.md 拆成 document/ai/{ROADMAP(里程碑),PLAN(批级 P0-a/b/c)}.md 对齐 CinuxOS 分层;7 命令重指 document/ai/ 并对齐 @-ref 模式;document/notes/ 占位。约定两仓对齐,Dev/Claude 无缝切换。
…map-restart [feature]: Restart Roadmap
- 新增 GuiCore:core 会话状态,拥有 staging Surface(跨帧复用) - pump 状态化:pump(Host*) → GuiCore::pump(),pump.hpp/cpp 合并进 gui_core - Frame::pixels const void*→void*:host 经 staging 可写(in-process 契约) - pump 预填 staging→render_frame→region 收脏→flush;region 代数进渲染路径 - host.hpp 加 bytes_per_pixel;fake_host 加 staging 所有权 + region-on-path 断言
- scripts/gen_font_data.py: font.psf -> core/font_psf_data.hpp (constexpr 数组)
- core/font.{hpp,cpp}: PsfFont 显式 LE 解析 PSF2 header(无 UB),glyph(c) 索引
- PsfFont.glyph() 直接喂 swraster::glyph_blit(PSF 每 row 1 byte = bytes_per_row)
- fake_host 加字体单测: parse 8x16/256 + 'A' 非空 vs ' ' 空
- PLAN: P0-b 拆 b1/b2/b3
- host/ppm_writer.{hpp,cpp}: XRGB8888→P6 binary(memcpy 逐像素无 UB)
- host/offscreen_host_main.cpp: render_frame 画静态场景 + pump + dump + 像素自校验
- 场景: bg + 窗口(face+边框) + 标题栏 + 标题/多行文字 + 光标
- draw_text(\n 多行)/draw_rect_outline helper; 空 flush(offscreen 无屏)
- CMakeLists 加 offscreen-dump executable + ctest; .gitignore 加 *.ppm
- host/replay_host_main.cpp: 脚本事件→poll_event→dispatch_event (事件 ABI) - host 状态机: cursor 移动 / down 命中标题栏拖拽 / move+drag 窗口跟 delta / up 停 - render_frame 报真脏区(首帧全屏 / 后续 old+new cursor/win bbox / idle count=0) - 断言: 每帧 cursor/win 几何 + 脏区纪律(idle 0 / 首帧全屏 / 后续<全屏+新cursor在flushed) - CMakeLists 加 replay-dump + ctest - PLAN: P0-b3 ✅, P0-c 被吸收(结构断言代替金帧 fixture), P0 Probe-0 完成
…ing-ownership Stage: Setting up the workflow and migrations basic
- host/fbdev_device.{hpp,cpp}: fbdev open/ioctl(FBIOGET_*)/mmap + blit_rect(按 fb stride)
- host/evdev_device.{hpp,cpp}: EvdevAccumulator 纯函数(input_event 流→pointer frame, SYN 同步) + EvdevDevice fd(EVIOCGRAB + O_NONBLOCK)
- host/linux_fbdev_main.cpp: Host 表(flush→fbdev mmap / poll→evdev) + 场景 + 拖拽状态机 + 主循环(~60fps)
- test/test_evdev.cpp: EvdevAccumulator 单测(idle/move/down/up/held/noop/多键); 纯单测进 test/ 目录
- CMakeLists: fbdev-host(手动冒烟,非 ctest) + evdev-test(ctest)
- CODING-TASTE §2: test/ 目录约定(纯单测 vs host harness main)
- ROADMAP/PLAN: P1 进行中(代码✅+单测; QEMU 冒烟待手动)
- scripts/smoke_p1.sh: 缓存 Alpine virt ISO + sha256 + 起 QEMU(vesafb+usb-tablet+VNC:99) + 9p 源码共享 + serial capture + monitor screendump + 自动 gates(boot/device/run/no-crash) - scripts/guest_smoke_p1.sh: guest(mount 9p + apk 原生编译 + 发现 tablet event + timeout 40 跑 fbdev-host),输出重定向 serial 供 host grep - host/linux_fbdev_main.cpp: 设备路径走 argv(argv[1]=fb, argv[2]=event; 默认不变) - VNC :99 (TCP 5999) 远离 CinuxOS 默认 :0 (5900) - 半自动(host 准备+gate / VNC 手动跑 guest); 全自动 apkovl 标 TODO
- scripts/smoke_p1_drive.py: 连 QEMU serial unix socket,tee guest 输出到 host 控制台+log,自动 login+mount 9p+跑 guest 脚本(替代 VNC 手动操作) - smoke_p1.sh: -serial unix sock(server,nowait) + 调 drive.py; preflight 加 python3; VNC 改可选(只看屏+鼠标) - .gitignore 加 __pycache__ - 解决「操作在 VNC 手动」+ 9p mount 成败直接回流 host 控制台
…h tag) - smoke_p1.sh: -virtfs → -fsdev local,id=srcdev + -device virtio-9p-pci (显式 attach,mount_tag 确定 register) - drive.py: mount 前 modprobe 9pnet_virtio/9p + ls /sys/bus/virtio/devices (诊断模块/设备) - 根因: -virtfs helper 在该 QEMU 配置没把 9p 设备 attach,guest "mount -t 9p host0" 报 ENOENT (tag 找不到,非模块缺)
…mod / dmesg) - mount 前列各 virtio 设备 modalias(9p device id=0x0009 确认 9p 设备在不在) - grep 9p /proc/filesystems + lsmod 9p(模块/文件系统注册) - mount 失败后 dmesg | grep 9p/virtio(看 tag 注册/绑定报错) - QEMU virtio-9p-pci 属性确认 mount_tag=正确,非属性名问题
- drive.py: mount 前 dmesg | grep 9p/vin(看 kernel 实际注册的 tag); 试 host0/srcdev × (trans=virtio[+version]) 组合,MOUNTED_AS 报中的 - guest_smoke_p1.sh: mountpoint -q 已挂跳过(drive.py 用对的 tag 挂了就不重挂) - 9p 设备(0x0009)+fs+模块都在,ENOENT 是 tag 不匹配; dmesg 定位真实 tag
- smoke_p1.sh: -fsdev 去掉 readonly=on(怀疑 backend probe 失败致 driver 不 bind; mount -o ro 控制只读) - drive.py DIAG: dump 每个 virtio 设备的 driver(virtio_9p/none)+ modalias, 确认 9p 设备 driver 是否真 bind - 根因方向: virtio:d00000009 设备 enum 了但 dmesg 无 virtio_9p probe -> driver 没 bind
- 9p 诊断定论: virtio1 driver=9pnet_virtio 设备+driver+fs+模块全就绪,但 mount tag host0/srcdev 全 ENOENT (QEMU mount_tag<->kernel 9p tag 深层问题,不再纠缠) - 改 HTTP: smoke_p1.sh 起 python3 http.server :8765(serve $ROOT) + tar 源码(src.tar.gz) - drive.py: login + busybox wget guest 脚本(http 10.0.2.2) + sh - guest 脚本: apk add cmake g++ + wget src.tar.gz + untar + 原生编译 + 发现 tablet + timeout 40 fbdev-host - QEMU 去 9p(-fsdev/-device virtio-9p-pci),保留 -netdev user(10.0.2.2=host); VNC:99 不变
- smoke_p1.sh: http.server --bind 0.0.0.0 + 起来后 urllib 自检 127.0.0.1:PORT(没起直接 die,别浪费时间到 QEMU) - drive.py: wget 加 -T 15(15s 超时,快失败看错误: refused=server没起/timeout=SLIRP不通) - 上轮 wget 连 10.0.2.2:8765 卡死无 GS= -> HTTP 链路问题,先定位 host server + 快速失败
放弃 Alpine ISO + 9p/HTTP/VNC 三方案(9p tag 不匹配/SLIRP wget 卡死/VNC 手动驱不符 CI), 改用 PenguinLab 源码自构建: x86_64 defconfig + 强开 DRM_BOCHS/FBDEV_EMULATION/USB_XHCI 的 bzImage + 静态 busybox initramfs(自带 fbdev-host + /init),零 guest->host transport。 /init 发现 fb0(bochs-drmdrmfb) + usb-tablet(/proc/bus/input/devices grep,非 sysfs glob), 跑 fbdev-host /dev/fb0 /dev/input/event3 跑满 40s 不崩。像素采样验场景画对 (背景/标题栏/窗口面/光标色全匹配)。 - 新增 build_kernel_x86_64.sh / build_busybox_x86_64.sh / build_fbdev_host_static.sh / build_initramfs.sh - smoke_p1.sh 改 -kernel/-initrd 路线,VNC :99 避 CinuxOS 默认 :0 - 删 guest_smoke_p1.sh / smoke_p1_drive.py(旧 Alpine 双向 serial 驱动) - notes/2026-06-30 重写为自构建方案 + PASS 结果 + 像素证据 + 坑记录 - ROADMAP/PLAN: P0+P1 标完成
…nt_list Desktop 成员 - Compositor::render cursor 从 4x4 方块改 16x16 经典箭头 bitmap(1px 灰主体+白描边) - WindowManager kCursorSize 4->16 + cursor footprint invalidate +1px pad(覆盖描边) - WindowManager override clear_dirty 递归 windows_(对齐 collect_dirty; 治 Window dirty_rect_ 跨帧累积 -> 拖出屏幕吃负坐标 -> flush 整片跳过的花屏) - Desktop 持有 paint_list_ 成员(避 128KB PaintList 在 8KB kernel 栈爆)
- core/icon_data.hpp: 32x32 icon 像素数据 + 1-bpp mask(从老 desktop 搬 shape,
palette 换琥珀暖橙:Shell 深棕 body+琥珀 cursor;Calc 暖米 body+琥珀 LCD)
- core/widget/desktop_icon.{hpp,cpp}: DesktopIcon widget(set_bitmap/label/
on_activate),paint 逐像素 fill_rect(mask 非透明)+ label,on_pointer
down+up in rect 触发 on_activate
- WindowManager: icons_ 数组(add_icon + paint bg->icons->windows + collect/
clear_dirty 递归 icons_ + process_pointer 加 icon click hit-test)
- CMakeLists: 加 desktop_icon.cpp
- terminal: prev_cursor_row_(光标行 dirty 擦 trail)+ CSI J mode 0/1/2 精确到 cursor 列(修 clear/backspace 误擦 prompt)+ DEL(0x7f)当退格 + blue palette[4] 调亮(深底清晰) - window: collect_dirty/clear_dirty override 显式递归 content_(修 scroll dirty_all_ 不传 WM) - window_manager: 删 bg_ 直读 theme_->background(单一源)+ on_remove 回调(host 收通知清 PTY,reopen) - theme: dark background 深咖啡 0x2A1C12(was 纯黑)
- 新建 core/colors.hpp:集中 ANSI 16 palette + Material light/dark 色值 (XRGB8888),单一源头方便调色 - theme.cpp: material_light/dark 引用 colors::light/dark - terminal.cpp: 删本地 kAnsiPalette,引用 colors::kAnsiPalette - palette[4]/[12] blue #0000FF -> #5FADFF(亮天蓝,深底清晰) ctest 22/0 绿(含 terminal-ansi/bg256 验 palette)。
ANSI BS(0x08) 之前和 0x7f 共用抹字符逻辑, ash line-edit 左移发 \b 被当删除 -> 经过字符被吃. 拆开: \b 只移光标, 0x7f(DEL) 才删. 补 CSI A/B/C/D (CUU/CUD/CUF/CUB) 光标移动 (原 dispatch_csi_ default 忽略, 方向键序列不动光标).
七维度全仓扫描(15 find agent + skeptic 逐条复核 + 2 补扫): 62 confirmed + 18 补扫,按族归并 22 条新债登记。 killpg 订正为活跃 UAF(DEBT-002 安全前提已失效)。 每条附复现策略(deterministic/LOCKDEP铺桩/stress/host/QEMU不可复现), 支撑后续复现战役(R1-R5 五批,分支 fix/llm-audit-debt 承接)。 报告: document/todo/quality/reports/2026-08-14-llm-static-audit.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这里机械的迁移了第三方仓库回来了,原因很简单,没有消费方,就不多维护新仓库