chore(task): archive 06-27-fix-kg-compute
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
|
||||||
20
.trellis/tasks/archive/2026-06/06-27-fix-kg-compute/prd.md
Normal file
20
.trellis/tasks/archive/2026-06/06-27-fix-kg-compute/prd.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# 修复 KeyGen 计算路径
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
修复 `mlkem_top.v` 中 KeyGen 的占位状态,实现 t_hat、pk、sk 的实际计算,使 `./run_tb.sh top` 中 KeyGen 产生非零输出。
|
||||||
|
|
||||||
|
## Current Issues
|
||||||
|
1. KeyGen 的 t_hat 计算(poly_mul + poly_arith)是占位:`phase_done <= 1'b1`
|
||||||
|
2. `pk_o_r` / `sk_o_r` 从未被赋值(默认 0)
|
||||||
|
3. `rng_valid_i` 竞态(可能已跨过,仿真确认 FSM 在跑)
|
||||||
|
|
||||||
|
## Fix Plan
|
||||||
|
1. 实现 `S_KG_TMUL_LOAD/COMP/OUT` 状态 → 调用 poly_mul_sync 计算 t_hat
|
||||||
|
2. 实现 `S_KG_ADD` → 调用 poly_arith_sync
|
||||||
|
3. 在 `S_KG_DONE` 中赋值 `pk_o_r = {t_hat polys, rho}` 和 `sk_o_r = {s_hat polys}`
|
||||||
|
4. 验证:`./run_tb.sh top` KeyGen 输出非零
|
||||||
|
|
||||||
|
## Out of Scope
|
||||||
|
- Encaps/Decaps 修复
|
||||||
|
- pk/sk ByteEncode 编码(先输出 raw 12-bit coeffs)
|
||||||
|
- KAT 数值完全匹配
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"id": "fix-kg-compute",
|
||||||
|
"name": "fix-kg-compute",
|
||||||
|
"title": "修复KeyGen计算路径并输出正确的pk/sk",
|
||||||
|
"description": "",
|
||||||
|
"status": "completed",
|
||||||
|
"dev_type": null,
|
||||||
|
"scope": null,
|
||||||
|
"package": null,
|
||||||
|
"priority": "P2",
|
||||||
|
"creator": "FallenSigh",
|
||||||
|
"assignee": "FallenSigh",
|
||||||
|
"createdAt": "2026-06-27",
|
||||||
|
"completedAt": "2026-06-27",
|
||||||
|
"branch": null,
|
||||||
|
"base_branch": "main",
|
||||||
|
"worktree_path": null,
|
||||||
|
"commit": null,
|
||||||
|
"pr_url": null,
|
||||||
|
"subtasks": [],
|
||||||
|
"children": [],
|
||||||
|
"parent": null,
|
||||||
|
"relatedFiles": [],
|
||||||
|
"notes": "",
|
||||||
|
"meta": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user