Round #837

10 May 2026, 21:10· csharp· Meta-Llama-3.3-70B-Instruct· r15-firing-v3-preflight
Complexity
band 1
ZP / UO / OBS
5 / 6 / 1
Journey weight
890
Lightshift ΔL
+0.00

Prompt

Build a SignalR Hub that lets clients subscribe to a 'price-tick' channel and broadcasts ticks to all subscribers on a one-second timer.

Zero-point index (what the engine surfaced)

ZPI-ZPI-0004 | 2026-05-10T21:10:39Z Build a SignalR Hub that lets clients subscribe to a 'price-tick' channel and broadcasts ticks to all subscribers on a one-second timer. ZERO POINT — 5 entries (structural invariants) ● hsl(337.38, 100%, 32%) IPublishEndpoint [contract] ● hsl(116.66, 100%, 32%) IConsumer<T> [contract] ● hsl(352.98, 100%, 30%) IBus [contract] ● hsl(23.16, 100%, 15%) Hub [contract] ● hsl(264.37, 100%, 15%) IHubContext<THub> [contract] UNOBSERVED — 6 entries (implied truths) ○ hsl(27.69, 100%, 50%) async [feature] ○ hsl(3.75, 100%, 38%) CancellationToken [feature] ○ hsl(216.00, 100%, 26%) Message broker publish [function] ○ hsl(31.38, 100%, 42%) Scoped registration [function] ○ hsl(310.15, 100%, 7%) WebSocket communication [function] ○ hsl(201.23, 100%, 7%) Channel of T producer [function] OBSERVED — 1 entries (explicit in request) ◉ hsl(73.85, 100%, 15%) on [feature] COMPLEXITY │ 12 entries │ spread: 306° │ band: MEDIUM

Baseline response (no ZPI)

**SignalR Hub for Price Ticks** ================================ Below is an example implementation of a SignalR Hub in C# that allows clients to subscribe to a 'price-tick' channel and broadcasts ticks to all subscribers on a one-second timer. ### PriceTickHub.cs ```csharp using Microsoft.AspNetCore.SignalR; using System; using System.Threading; using System.Threading.Tasks; public class PriceTickHub : Hub { private readonly Timer _timer; public PriceTickHub() { _timer = new Timer(BroadcastPriceTick, null, TimeSpan.Zero, TimeSpan.FromSeconds(1)); } public async Task SubscribeToPriceTicks() { await Groups.AddToGroupAsync(Context.ConnectionId, "price-ticks"); Console.WriteLine($"Client {Context.ConnectionId} subscribed to price ticks"); } public async Task UnsubscribeFromPriceTicks() { await Groups.RemoveFromGroupAsync(Context.ConnectionId, "price-ticks"); Console.WriteLine($"Client {Context.ConnectionId} unsubscribed from price ticks"); } private void BroadcastPriceTick(object state) { // Simulate a price tick var priceTick = new PriceTick { Price = new Random().NextDouble() * 100 }; // Broadcast the price tick to all subscribers Clients.Group("price-ticks").SendAsync("ReceivePriceTick", priceTick); } public override async Task OnConnectedAsync() { await base.OnConnectedAsync(); Console.WriteLine($"Client {Context.ConnectionId} connected"); } public override async Task OnDisconnectedAsync(Exception exception) { await base.OnDisconnectedAsync(exception); Console.WriteLine($"Client {Context.ConnectionId} disconnected"); } } public class PriceTick { public double Price { get; set; } } ``` ### Startup.cs ```csharp using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddSignalR(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapHub<PriceTickHub>("/price-tick-hub"); }); } } ``` ### Client-Side Example (JavaScript) ```javascript const connection = new signalR.HubConnectionBuilder().withUrl("/price-tick-hub").build(); connection.on("ReceivePriceTick", (priceTick) => { console.log(`Received price tick: ${priceTick.price}`); }); connection.start().then(() => { connection.invoke("SubscribeToPriceTicks").catch((err) => { return console.error(err.toString()); }); }).catch((err) => { return console.error(err.toString()); }); ``` ### Client-Side Example (C#) ```csharp using Microsoft.AspNetCore.SignalR.Client; using System; using System.Threading.Tasks; public class PriceTickClient { private readonly HubConnection _connection; public PriceTickClient(string url) { _connection = new HubConnectionBuilder().WithUrl(url).Build(); } public async Task Start() { _connection.On<PriceTick>("ReceivePriceTick", (priceTick) => { Console.WriteLine($"Received price tick: {priceTick.Price}"); }); await _connection.StartAsync(); await _connection.InvokeAsync("SubscribeToPriceTicks"); } public async Task Stop() { await _connection.InvokeAsync("UnsubscribeFromPriceTicks"); await _connection.StopAsync(); } } class Program { static async Task Main(string[] args) { var client = new PriceTickClient("https://localhost:5001/price-tick-hub"); await client.Start(); Console.ReadLine(); await client.Stop(); } } ``` This implementation provides a basic SignalR Hub that broadcasts price ticks to all subscribed clients on a one-second timer. The `PriceTickHub` class handles client connections, subscriptions, and broadcasts, while the `PriceTick` class represents a single price tick. The client-side examples demonstrate how to connect to the hub, subscribe to price ticks, and receive updates in both JavaScript and C#.

Enhanced response (with ZPI)

```csharp using Microsoft.AspNetCore.SignalR; using System; using System.Threading; using System.Threading.Tasks; public class PriceTickHub : Hub { private readonly Timer _timer; public PriceTickHub() { _timer = new Timer(BroadcastPriceTick, null, TimeSpan.Zero, TimeSpan.FromSeconds(1)); } public async Task SubscribeToPriceTick() { await Groups.AddToGroupAsync(Context.ConnectionId, "price-tick"); } public async Task UnsubscribeFromPriceTick() { await Groups.RemoveFromGroupAsync(Context.ConnectionId, "price-tick"); } private void BroadcastPriceTick(object state) { var random = new Random(); var priceTick = new PriceTick { Price = random.NextDouble() * 100 }; Clients.Group("price-tick").SendAsync("ReceivePriceTick", priceTick); } public class PriceTick { public double Price { get; set; } } } ``` In the Startup.cs file, add the SignalR service and configure the hub: ```csharp public void ConfigureServices(IServiceCollection services) { services.AddSignalR(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapHub<PriceTickHub>("/priceTickHub"); }); } ``` To use the hub, clients can connect to the `/priceTickHub` endpoint and call the `SubscribeToPriceTick` method to start receiving price ticks. The `BroadcastPriceTick` method is called every second to send a new price tick to all subscribed clients. This implementation requires additional text to fully explain the usage and configuration of the SignalR hub.

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
Worse
V4qwen2.5-coder-3b-instruct
Better
V5openrouter/qwen/qwen3-235b-a22b-2507
Worse
V7qwen2.5-coder-7b-instruct
Worse
V8openai/gpt-4.1
Worse
V9anthropic/claude-opus-4-7
Worse
V12openai/gpt-4o
Same

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