Skip to content

Commit a7462e4

Browse files
committed
📝 docs: final submission prep - AI declaration, links, site redesign, PPT
- 07_appendix.tex: add AI tool usage declaration (§G) - 01_abstract.tex: add project links (homepage/gitlab/bilibili/baidu) - README.md: add project links table in overview section - site/: redesign all pages (industrial-technical aesthetic), GitHub→GitLab links, embed Bilibili demo video on homepage - reports/SLIM-ARC展示PPT.pdf: add presentation slides - scripts/prepare-gitlab-v6.py: update exclude rules (reports only PDF+PNG) - docs/bug-wsl2-network-bind.md: record WSL2 network stack bug - ROADMAP.md: record WSL2 bug + lessons learned PDF: 38 pages. All links verified.
1 parent 3c43d40 commit a7462e4

18 files changed

Lines changed: 657 additions & 125 deletions

AGENT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- **量化**: IQ4_XS 为主(80B),Q4_K_M 用于精度对比,KV Q4_0 量化
2424
- **CPU**: 纯 CPU 推理,不使用 GPU
2525
- **代理**: `http://127.0.0.1:7897`(外部网络请求)
26+
- **修改文件**:必须使用 apply_diff 工具,且 **记得提供 path 参数**,否则可能失败。**path 在前,diff 在后**
2627

2728
## 代码组织规则
2829

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ SLIM-ARC 是 2026 全国大学生系统能力大赛操作系统设计赛 Proj 59
3030
3131
通过 `posix_madvise(MADV_RANDOM)` 这一标准 POSIX 接口,系统能够精确地只加载被 MoE Router 激活的专家权重(10/512 = 2%),将 45GB 模型的物理内存占用降至接近实际访问量(~2GB),无需复杂的用户态内存管理或模型结构修改。
3232

33+
### 📎 项目链接
34+
35+
| 资源 | 链接 |
36+
|:---|:---|
37+
| 🌐 项目主页 | https://slim.nexa-lang.com/ |
38+
| 📦 项目仓库(GitLab) | https://gitlab.eduxiji.net/T2026105589911358/project3136859-389100 |
39+
| 🎬 项目介绍与 Demo 视频(B站) | https://www.bilibili.com/video/BV1fXTF6HEAw |
40+
| 📄 项目报告 PDF | [`reports/Competition_Report/main.pdf`](reports/Competition_Report/main.pdf) |
41+
| 📑 展示 PPT | [`reports/SLIM-ARC展示PPT.pdf`](reports/SLIM-ARC展示PPT.pdf) |
42+
| 📁 报告+实机Demo+PPT(百度网盘) | https://pan.baidu.com/s/1i83bdq-oiqOCvga3g05v8g (提取码 `m8yy`|
43+
3344
## 核心成果
3445

3546
<div align="center">

ROADMAP.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
---
44

5+
## 2026-06-30 WSL2 网络栈 Bug(未修复)
6+
7+
### 变更描述
8+
发现 WSL2 内核 6.18.35.2 的 TCP bind 系统调用异常:所有指定端口 bind() 返回 EADDRINUSE,但 /proc/net/tcp 无占用记录。导致 llama-server 和 Python http.server 都无法启动端口监听。6/29 能跑,6/30 突然不行,代码未变。
9+
10+
### 影响
11+
- Demo 系统(scripts/demo/)无法运行,无法录屏
12+
- 详见 [`docs/bug-wsl2-network-bind.md`](docs/bug-wsl2-network-bind.md)
13+
14+
### 建议修复(用户在 Windows 侧)
15+
- `wsl --shutdown` + `netsh winsock reset` + `netsh int ip reset` + 重启电脑
16+
- 或改用 bind(0) 随机端口方案(llama_cli_server.py)
17+
18+
### 教训
19+
1. 诊断 WSL2 网络问题时应先检查 `/proc/net/tcp``dmesg`,不要盲目重启
20+
2. 绝不盲目 `kill -9` 未知 PID(曾误杀 VSCode Server 进程导致 VSCode 重连)
21+
3. WSL2 内核网络栈不稳定,比赛环境应准备纯 Linux 备用机
22+
23+
---
24+
525
## 2026-06-26 审计修复 + 文档全面更新
626

727
### 变更描述

docs/bug-wsl2-network-bind.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# WSL2 网络栈 Bug 记录(未修复)
2+
3+
## 状态:🔴 未修复
4+
5+
## 发现日期
6+
2026-06-30
7+
8+
## 问题描述
9+
10+
WSL2 内核 `6.18.35.2-microsoft-standard-WSL2` 的 TCP bind 系统调用出现严重异常:**所有指定端口的 bind() 都返回 EADDRINUSE,但 `/proc/net/tcp``ss` 都看不到端口被占用**
11+
12+
## 症状
13+
14+
1. `python3 -c "import socket; s=socket.socket(); s.bind(('127.0.0.1', 8080))"``EADDRINUSE`
15+
2. 换任何端口(18080, 28080, 50000 等)都同样失败
16+
3. `bind(0)`(随机端口)能成功
17+
4. `/proc/net/tcp` 里没有 8080 端口的任何 socket
18+
5. `ss -tlnp` 看不到 8080 监听
19+
6. `dmesg` 显示 `WSL ERROR: CheckConnection: getaddrinfo() failed: -5`
20+
7. Unix domain socket 能正常 bind
21+
22+
## 影响范围
23+
24+
- **llama-server 无法启动**:HTTP bind 端口时 abort(`munmap_chunk(): invalid pointer` 是 bind 失败后清理路径的堆 corruption)
25+
- **Python http.server 无法启动**:同样 bind EADDRINUSE
26+
- **Demo 系统(scripts/demo/)完全不可用**:无法录屏演示
27+
- **6/29 能正常跑,6/30 突然不行**,代码和二进制未变
28+
29+
## 根因分析
30+
31+
这不是端口冲突(`/proc/net/tcp` 证明),是 **WSL2 内核的网络协议栈状态异常**。可能是:
32+
- Windows 更新导致 WSL2 内核网络模块状态不一致
33+
- WSL2 的 hyper-v 网络适配器残留状态
34+
- glibc malloc 与 llama-server 全局对象析构的偶发性冲突(但 Python 也失败,排除此假设)
35+
36+
## 已尝试的修复(均无效)
37+
38+
1. ✗ 重启 WSL(`wsl --shutdown` + 重开)— 用户已执行,无效
39+
2. ✗ 重启 Windows 电脑 — 用户已执行,无效
40+
3. ✗ 重新编译 llama-server — 无效(不是二进制问题)
41+
4.`SLIM_ARC_DISABLE=1` 禁用 SLIM-ARC patch — 无效(不是 patch 问题)
42+
5.`MALLOC_CHECK_=3` 禁用 glibc 堆检查 — 无效
43+
6. ✗ 换 IPv6 `::1` — 同样 EADDRINUSE
44+
7.`bind(0)` 随机端口 — 能成功(workaround 基础)
45+
46+
## 建议修复方案(用户在 Windows 侧执行)
47+
48+
### 方案 A(首选):重置 Winsock
49+
在 Windows PowerShell(管理员)执行:
50+
```powershell
51+
wsl --shutdown
52+
netsh winsock reset
53+
netsh int ip reset
54+
```
55+
然后**重启电脑**
56+
57+
### 方案 B:重置 WSL 网络
58+
```powershell
59+
wsl --shutdown
60+
wsl --unregister Ubuntu # ⚠️ 这会删除 WSL 数据,先备份!
61+
# 然后从 Microsoft Store 重装 WSL
62+
```
63+
64+
### 方案 C(临时 workaround):用 bind(0) 随机端口
65+
修改 demo 脚本,让所有服务 bind(0) 自动选端口,前端动态获取端口。但 llama-server 不支持端口 0,需要改用 llama-cli + Python SSE server 方案。
66+
67+
## 相关文件
68+
69+
- [`scripts/demo/`](scripts/demo/) — Demo 系统(受影响)
70+
- [`logs/demo-*.log`](logs/) — 各种尝试的日志
71+
- `src/llama-upstream/build/bin/llama-server` — 二进制本身正常(`--version` 能输出)

reports/Competition_Report/main.aux

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
\newlabel{tab:team}{{20}{32}{团队分工\relax }{table.caption.59}{}}
241241
\@writefile{toc}{\contentsline {subsection}{\numberline {7.5}提交仓库目录与文件描述}{32}{subsection.7.5}\protected@file@percent }
242242
\@writefile{toc}{\contentsline {subsection}{\numberline {7.6}比赛收获}{33}{subsection.7.6}\protected@file@percent }
243+
\@writefile{toc}{\contentsline {subsection}{\numberline {7.7}AI 工具使用声明}{33}{subsection.7.7}\protected@file@percent }
243244
\bibstyle{IEEEtran}
244245
\bibdata{reference}
245246
\bibcite{flexinfer2025}{1}
@@ -272,7 +273,7 @@
272273
\bibcite{gsm8k2021}{28}
273274
\bibcite{wikitext2016}{29}
274275
\bibcite{cgroupsv2}{30}
275-
\newlabel{LastPage}{{}{36}{}{page.36}{}}
276-
\xdef\lastpage@lastpage{36}
277-
\xdef\lastpage@lastpageHy{36}
278-
\gdef \@abspage@last{37}
276+
\newlabel{LastPage}{{}{37}{}{page.37}{}}
277+
\xdef\lastpage@lastpage{37}
278+
\xdef\lastpage@lastpageHy{37}
279+
\gdef \@abspage@last{38}

reports/Competition_Report/main.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@
6767
\BOOKMARK [2][-]{subsection.7.4}{\376\377\122\006\135\345\116\016\123\117\117\134}{section.7}% 67
6868
\BOOKMARK [2][-]{subsection.7.5}{\376\377\143\320\116\244\116\323\136\223\166\356\137\125\116\016\145\207\116\366\143\317\217\360}{section.7}% 68
6969
\BOOKMARK [2][-]{subsection.7.6}{\376\377\153\324\215\133\145\066\203\267}{section.7}% 69
70+
\BOOKMARK [2][-]{subsection.7.7}{\376\377\000A\000I\000\040\135\345\121\167\117\177\165\050\130\360\146\016}{section.7}% 70
4.82 KB
Binary file not shown.

reports/Competition_Report/main.toc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@
9393
\contentsline {subsection}{\numberline {7.4}分工与协作}{32}{subsection.7.4}%
9494
\contentsline {subsection}{\numberline {7.5}提交仓库目录与文件描述}{32}{subsection.7.5}%
9595
\contentsline {subsection}{\numberline {7.6}比赛收获}{33}{subsection.7.6}%
96+
\contentsline {subsection}{\numberline {7.7}AI 工具使用声明}{33}{subsection.7.7}%

reports/Competition_Report/sections/01_abstract.tex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,14 @@
1515

1616
\noindent\textbf{关键词}:端侧 LLM 推理;MoE 稀疏性;虚拟内存优化;按需加载;KV Cache 量化;FlashAttention
1717

18+
\vspace{1.5em}
19+
20+
\noindent\textbf{项目链接}\\[0.3em]
21+
\begin{tabular}{@{}ll@{}}
22+
项目主页 & \url{https://slim.nexa-lang.com/} \\
23+
项目仓库 & \url{https://gitlab.eduxiji.net/T2026105589911358/project3136859-389100} \\
24+
项目介绍与Demo视频 & \url{https://www.bilibili.com/video/BV1fXTF6HEAw} \\
25+
项目报告/视频/PPT & 百度网盘: \url{https://pan.baidu.com/s/1i83bdq-oiqOCvga3g05v8g} \quad 提取码: \texttt{m8yy} \\
26+
\end{tabular}
27+
1828
\newpage

reports/Competition_Report/sections/07_appendix.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,9 @@ \subsection{比赛收获}
113113
\end{itemize}
114114

115115
我们相信,操作系统虚拟内存机制与 MoE 稀疏性的深度协同,是解决端侧大模型推理"内存墙"问题的关键路径,这一思路对未来的端侧 Agent 系统设计具有参考价值。
116+
117+
\subsection{AI 工具使用声明}
118+
119+
在本项目的开发过程中,我们合理使用了 AI 辅助工具以提升工程效率。具体而言,AI 工具主要在以下方面提供了辅助:代码实现的样板生成与调试、文档的初稿撰写、实验数据的格式化整理,以及重复性脚本的编写。所有 AI 生成的内容均经过团队成员的人工审查、验证与修改,核心技术决策、系统架构设计、实验方案制定和学术判断均由团队成员独立完成。
120+
121+
我们始终坚持学术诚信原则:所有实验数据均来自真实的冷启动推理运行,可溯源至 \texttt{logs/} 目录下的原始日志;所有引用的论文均经过团队成员阅读和核实;AI 工具的使用情况在 Git commit message 和项目文档中均有记录。项目的核心创新——利用 MADV\_RANDOM 作为 MoE 稀疏性的操作系统接口——源于团队成员对虚拟内存机制与 MoE 架构的深入分析,是人工思考的成果,并非 AI 生成。

0 commit comments

Comments
 (0)