From 97f9bdcf9027be32971dc82a9b3d26d3639132c5 Mon Sep 17 00:00:00 2001 From: MarkBase Admin Date: Mon, 6 Jul 2026 01:31:33 +0800 Subject: [PATCH] v2: add full context 2048-token, repeated tokens, edge token tests --- Tests/01_Model/LongContext12BTest.swift | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Tests/01_Model/LongContext12BTest.swift b/Tests/01_Model/LongContext12BTest.swift index ac325b0..df8689d 100644 --- a/Tests/01_Model/LongContext12BTest.swift +++ b/Tests/01_Model/LongContext12BTest.swift @@ -54,6 +54,67 @@ final class LongContext12BTest: XCTestCase { } } + func testFullContext2048Tokens() throws { + try XCTSkipIf(model == nil, "12B model not found") + + let promptLength = maxCtx + var tokens = [Int]() + for i in 0.. maxVal { maxVal = logits[j]; maxIdx = j } + } + genTokens.append(maxIdx) + print(" gen[\(i)]: token=\(maxIdx) logit=\(maxVal)") + } + } + + func testRepeatedTokensFullContext() throws { + try XCTSkipIf(model == nil, "12B model not found") + + let promptLength = maxCtx / 2 + for (pos, _) in (0..