Round #873

11 May 2026, 09:54· csharp· Meta-Llama-3.3-70B-Instruct· r15-firing-v3
Complexity
band 0
ZP / UO / OBS
3 / 0 / 2
Journey weight
320
Lightshift ΔL

Prompt

Use a Span<char> to parse an integer from a string slice without allocating. Compare to int.Parse(string) qualitatively.

Zero-point index (what the engine surfaced)

ZPI-ZPI-0005 | 2026-05-11T09:54:43Z Use a Span<char> to parse an integer from a string slice without allocating. Compare to int.Parse(string) qualitatively. ZERO POINT — 3 entries (structural invariants) ● hsl(7.18, 100%, 50%) class [feature] ● hsl(0.00, 100%, 50%) public [feature] ● hsl(84.10, 100%, 50%) namespace [feature] UNOBSERVED — 0 entries (implied truths) OBSERVED — 2 entries (explicit in request) ◉ hsl(113.85, 100%, 15%) int [feature] ◉ hsl(133.33, 100%, 15%) string [feature] COMPLEXITY │ 5 entries │ spread: 19° │ band: LOW

Baseline response (no ZPI)

```csharp using System; class Program { static int ParseInt(string s) { int result = 0; foreach (char c in s) { if (char.IsDigit(c)) { result = result * 10 + (c - '0'); } else { throw new FormatException("Input string contains non-numeric characters"); } } return result; } static void Main() { string s = "12345"; Console.WriteLine(ParseInt(s)); // Output: 12345 } } ```

Enhanced response (with ZPI)

```csharp using System; public class IntegerParser { public static bool TryParseInteger(Span<char> input, out int result) { result = 0; int sign = 1; int index = 0; // Check for negative sign if (input.Length > 0 && input[0] == '-') { sign = -1; index++; } // Check for positive sign else if (input.Length > 0 && input[0] == '+') { index++; } for (; index < input.Length; index++) { if (input[index] >= '0' && input[index] <= '9') { // Check for overflow if (result > (int.MaxValue - (input[index] - '0')) / 10) { return false; } result = result * 10 + (input[index] - '0'); } else { return false; } } result *= sign; return true; } public static void Main() { var input = "123".AsSpan(); if (TryParseInteger(input, out int result)) { Console.WriteLine($"Parsed integer: {result}"); } else { Console.WriteLine("Failed to parse integer"); } } } ``` The `TryParseInteger` method using `Span<char>` avoids allocating memory by operating directly on the input string slice. In contrast, `int.Parse(string)` allocates memory for the string object and may throw exceptions for invalid input. The `Span<char>` approach is more efficient and safer, as it returns a boolean indicating success or failure instead of throwing exceptions. However, `int.Parse(string)` is often more convenient and easier to use, especially for simple cases. The choice between the two approaches depends on the specific requirements of the application, such as performance, memory usage, and error handling. This implementation requires more code and manual error checking, but provides more control and flexibility.

Grader chain

Each grader reads the same baseline + enhanced pair and casts an independent verdict. Disagreement is the framework's own signal — not noise to be averaged away.

V1samba/Meta-Llama-3.3-70B-Instruct
Better
V4qwen2.5-coder-3b-instruct
Better
V5openrouter/qwen/qwen3-235b-a22b-2507
Better
V7qwen2.5-coder-7b-instruct
Better
V8openai/gpt-4.1
Better
V9anthropic/claude-opus-4-7
Better
V12openai/gpt-4o
Better

Comments

Our grader said what it said. What do you say? Comment as a guest below.

No comments yet. Be the first to say what you make of this round.

← back to all rounds