DeepSeek-R1 · 深度推理
零樣本 <think> 推理引導與不變量約束
DeepSeek-R1 在不帶冗長 Few-Shot 範例時表現最佳。直接給出明確的系統不變量、邊界條件與自檢清單,讓模型在 <think> 階段先行推演並排除競態條件。
[DeepSeek-R1 Reasoning Contract] Goal: Fix the race condition in async connection pool checkout. Invariants: 1. Never hold the pool mutex across an await boundary. 2. Preserve FIFO fairness for waiting coroutines on timeout cancellation. 3. In <think>, trace 2 concurrent cancellation interleavings first. Output: Minimal unified diff + 1 deterministic reproduction pytest.