Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
166427 stories
·
33 followers

GIMP Fixes CMYK JPEG Loading Ahead of 3.3.2: Developers Verify an Issue Flagged by AI

1 Share

GIMP has merged a fix for loading CMYK JPEGs into its development branch ahead of version 3.3.2. After generative AI flagged a mismatch that also affected 8-bit CMYK JPEGs decoded at higher precision, developers verified and fixed it.

Key points

  • What happened: As part of the work on GIMP 3.3.2, developers corrected the pixel format used during color conversion for CMYK JPEGs.
  • Effect on image quality: Decoding even an 8-bit JPEG at 12-bit precision can preserve more tonal detail during editing.

Read the full article on Joho no Todai · Japanese original

Read the whole story
alvinashcraft
10 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Three Primitives for Building Agents in .NET

1 Share

I’ve been working on a new talk recently and I’ve been lucky enough to be able to present its first iteration a couple of times these past few months. It’s a tour of the agent harness behind Uno Platform Studio, the agent that builds .NET apps and is itself .NET. It runs both in your browser and on your desktop. By “harness” I mean everything we add around the model: the code that turns a chat API into an agent that actually builds apps.

Most of that talk is war stories. Workflow graphs, a router we designed and never shipped, and a skills system we built and then deleted. But none of it lands unless the room shares the same vocabulary first, so the talk opens with a short prelude on three primitives that everything else leans on. If you’re not a .NET developer: each concept transfers. The framework names are the only things that don’t.

Primitive 1: IChatClient Is the HttpClient of LLMs

The first one is an analogy .NET folks should immediately recognize. Microsoft.Extensions.AI (I’ll call it MEAI) gives you IChatClient, one interface for talking to any model family. Whatever SDK you use, you bridge it in once and the rest of your code only ever sees IChatClient:

1
2
3
IChatClient client = new OpenAIClient(key)
    .GetChatClient(model)
    .AsIChatClient();

The part that really matters is the second half of the analogy. Just like HttpClient has its DelegatingHandler chain, IChatClient has DelegatingChatClient. You wrap a client in another client and you get middleware. Telemetry is a decorator. So is tool calling, which we’ll get to in a second:

1
2
3
4
5
6
7
8
9
10
IChatClient client = new OpenAIClient(key)
    .GetChatClient(model)
    .AsIChatClient()
    .AsBuilder()
    .UseOpenTelemetry()
    .UseFunctionInvocation()
    .Build();

ChatResponse response = await client.GetResponseAsync("Explain IChatClient in one sentence.");
Console.WriteLine(response.Text);

The order of those Use calls is the order of the pipeline, first one outermost. Each position in that chain is a decision with a reason behind it, and moving one changes what the others see.

The builder is only a convenience, though. Each Use call wraps the client below it, so you can build the same pipeline with plain constructors:

1
2
3
4
5
6
IChatClient inner = new OpenAIClient(key)
    .GetChatClient(model)
    .AsIChatClient();

IChatClient client = new OpenTelemetryChatClient(
    new FunctionInvokingChatClient(inner));

Written this way, the order reads inside out: the deepest wrapper sits closest to the model, and the outermost one is the client you call. Uno Platform Studio builds its own, much longer chain like this, partly because it holds on to some of the layers it creates. Both styles produce the same pipeline, so use whichever reads better to you.

Two pipelines side by side. On the HTTP side: HttpClient, a logging DelegatingHandler, a retry DelegatingHandler, your own DelegatingHandler, HttpClientHandler, then any HTTP server. On the Microsoft.Extensions.AI side, step for step: IChatClient, UseOpenTelemetry, UseFunctionInvocation, your own DelegatingChatClient, the AsIChatClient bridge to the provider SDK, then any model.
Same shape, new payload. If you've written a DelegatingHandler, you already know how to write chat middleware.

Primitive 2: An Agent Turn Is a Tool Loop

Some quick definitions first

  1. A tool is a C# method you hand to the model, described to it by a name and a JSON schema. The model can’t run anything itself. Instead of answering, it replies with “please call WriteFile with these arguments.” Your code runs the method, sends the result back, and the model continues.

  2. By turn I mean everything between the user’s initial message and the agent’s final answer. Each trip to the model inside it is a round trip, and the tool loop is what keeps making those trips.

You may find other places that define a “turn” as each model call, but they are wrong and I am right. So we’ll stick with this definition throughout.

With MEAI, the tool is just a method and an attribute:

1
2
3
4
5
6
7
8
[Description("Writes a file to the project and returns a status message.")]
string WriteFile(string path, string contents)
{
    File.WriteAllText(path, contents);
    return $"Wrote {contents.Length} characters to {path}";
}

ChatOptions options = new() { Tools = [AIFunctionFactory.Create(WriteFile, name: "WriteFile")] };

Not much to it!

The loop itself comes from that UseFunctionInvocation() call earlier, which adds a FunctionInvokingChatClient to the pipeline. The model asks for a tool call, the client invokes your method, the result goes back to the model, and it repeats until the model answers with plain text, at which point the turn is complete.

The tool loop inside FunctionInvokingChatClient: a user prompt goes to the model, the model asks for a tool call, your C# method runs, the result is appended to the history and the whole history goes back to the model, repeating until the model answers with final text. Beside it, one example turn for build me a page takes six round trips: ReadFile, WriteFile, Build with errors, WriteFile with the fix, Build succeeded, then the final text.
One turn, many round trips. Every lap around the loop is a full request.

So “build me a page” is never one request. The model asks to read a file, then write one, then build, then read the build errors, then fix them, and around we go. One turn can easily be dozens of round trips.

And here’s the part that spices things up a bit: the API is STATELESS. The model remembers nothing between calls. Every one of those round trips re-sends the entire conversation from byte zero: the system prompt, every tool schema, every message so far.

You can see it right in the MEAI docs’ own chat loop, where you keep the history yourself and pass the whole thing every time:

1
2
3
4
5
6
7
8
9
10
List<ChatMessage> history = [];
while (true)
{
    history.Add(new(ChatRole.User, Console.ReadLine()));

    ChatResponse response = await client.GetResponseAsync(history, options);
    Console.WriteLine(response);

    history.AddMessages(response);
}

FunctionInvokingChatClient does the same thing inside a single turn. Every tool result gets appended, and the whole list goes back up.

Most importantly, you pay per token. Every single time. Now, if only there was some way to make the repeated parts of the request nearly free…

Man, I love a good segue

Primitive 3: The Cached Prefix Pays for Everything

The third primitive isn’t even code. It’s economics.

If every request re-sends everything, and you pay per token every time, the bill grows with every round trip of every turn. The thing that saves you is prompt caching: providers cache the byte-identical prefix of a request, and reading a cached prefix is much cheaper (and faster) than processing it from scratch.

The prefix has three parts:

  1. System: your standing instructions.
  2. Tools: every tool you register is serialized to a JSON schema and travels with every single request. This one is easy to forget about.
  3. Messages: the conversation so far.
Three consecutive requests drawn as bars of system prompt, tool schemas and messages. On round trips 2 and 3, everything the previous request already sent is a byte-identical prefix and comes from the cache, and only the new tool call and result are processed fresh. Below them, the same third request with one byte changed at the top of the system prompt re-pays everything after that byte.
Append to the end and the prefix stays cached. Change one byte at the top and you pay for all of it again.

Providers differ in the details. Anthropic caches tools, then system, then messages, and a change at one level invalidates that level and everything after it. OpenAI needs the entire rendered prefix to match, and even calls out the ordering of your tools as part of it. Either way, a stable prefix is nearly free, and one shifted byte re-pays everything after it.

That’s why so many decisions in our harness look the way they do:

  • Stable instructions. No timestamps or per-request values at the top of the system prompt. Anything dynamic goes at the end.
  • Byte-stable catalogues. If you inject a list of anything into the prompt, it gets generated in the same order every time.
  • Tool-list identity. Same tools, same descriptions, same order, on every request. Adding a tool mid-conversation re-pays the whole conversation. Which is exactly one of the mistakes that bit us in the ass at one point.
  • Append-only history. Rewriting an old message, even just to “clean it up,” throws away the cache for everything after it.

You can see it for yourself. The response tells you how much of each request came out of the cache, through UsageDetails.CachedInputTokenCount. A tiny piece of middleware shows it on every round trip:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public sealed class CacheReportingChatClient(IChatClient innerClient)
    : DelegatingChatClient(innerClient)
{
    public override async Task<ChatResponse> GetResponseAsync(
        IEnumerable<ChatMessage> messages,
        ChatOptions? options = null,
        CancellationToken cancellationToken = default)
    {
        ChatResponse response = await base.GetResponseAsync(messages, options, cancellationToken);

        if (response.Usage is { } usage)
        {
            Console.WriteLine($"input: {usage.InputTokenCount}, cached: {usage.CachedInputTokenCount}");
        }

        return response;
    }
}

Put it inside the tool loop so it sees each round trip, not just the end of the turn:

1
2
3
4
5
6
7
IChatClient client = new OpenAIClient(key)
    .GetChatClient(model)
    .AsIChatClient()
    .AsBuilder()
    .UseFunctionInvocation()
    .Use(inner => new CacheReportingChatClient(inner))
    .Build();

I only overrode GetResponseAsync to keep it short, so a real one would handle GetStreamingResponseAsync too. CachedInputTokenCount is also a fairly recent addition to MEAI, so make sure you’re on a current version.

Now change one character at the top of your system prompt between turns and watch that cached number fall off a cliff. It’s the fastest way I know to get a team to stop treating the cache as a nice-to-have.

Conclusion

So that’s the prelude to building an agent harness! Everything else in the talk (the workflow graphs, the router that never shipped, the skills system we deleted, the never-ending saga that is context engineering) is what happened next. If you’d like those war stories written up too, let me know!

Catch you in the next one :wave:



Read the whole story
alvinashcraft
10 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Catch Broken ASP.NET Core Configuration Before the First Request

1 Share
An ASP.NET Core application can start, pass a general health check that does not exercise an optional integration, and still fail on the first request that reaches a feature whose setting is missing or malformed. Follow one optional outbound integration from layered configuration providers to typed options. Find which provider supplied the value that won without printing the value. Make enablement explicit, require the endpoint only when the feature is enabled, and use ValidateOnStart so an invalid endpoint stops the host before it serves traffic. The validation messages name settings, never values. The article separates binding failures, which can echo the raw value, from validation failures, and shows what startup validation does not cover, including later reloads and whether the remote service is reachable or trustworthy.
Read the whole story
alvinashcraft
10 hours ago
reply
Pennsylvania, USA
Share this story
Delete

How To Use The Seasons In Your Writing

1 Share

Discover how to use the seasons, weather, and seasonal traditions to create atmosphere, develop characters, and add tension to your stories.

Come Rain Or Shine

Have you ever noticed how your moods often change with the seasons? Our senses pick up everything. The way we eat, dress, and socialise — a lot of this is dependent on the weather. Use this in your writing.

  1. Recently, I read a detective story set in a cold New York December. The writer used the elements of winter in a way that added drama to his story. The bloody body found in the snow, the grey sky, the detective’s black coat, and his red hair all formed a frame to set the mood.
  2. In another romance novel, a family retreats to their island home for the summer holidays. While the children run around in costumes and tan on the beach, their mother feels hot and frumpy in her dress. She yearns to swim but is self-conscious about her body.

For most of us, we only think about the weather as a backdrop to the story. If we look at it more closely, we soon see that it adds new vitality to the story — colouring emotions, infusing the plot, and bringing characters to life.

How To Use The Seasons In Your Writing

  1. Play with extremes. Use the setting. Make it the hottest day of the year, and your heroine’s car breaks down. The hero has to strip off his shirt to stay cool under the bonnet. What mood will this create? It has been raining for days, and the rain has washed the blood and fingerprints from a crime scene. How will this affect a police inspector’s mood and his case? Extreme seasonal weather can increase tension, create obstacles, and force characters into unexpected situations.
  2. A colourful palette. Each season gives you a paint box to add tone and description to your stories. A bride in an ivory gown gets married on the family farm. Her father has picked sunflowers from the fields, and a page boy wears a gold bow tie. These touches of gold and yellow add to a theme or set piece. Think like an artist when writing. Use the colours associated with each season to create atmosphere, reinforce emotions, and give your descriptions more depth.
  3. Think tradition. For many of us, we mark the seasons with traditions, both big and small. It is winter, so a grandmother starts her annual blanket-for-charity collection, but slips on the ice and is forced to spend time with her estranged granddaughter. A family goes on its annual summer camping trip in the woods, but one of the children disappears. How has the weather added tension or helped the plot along? Seasonal traditions can reveal family relationships, establish routines, and provide opportunities for conflict when things go wrong.

Five Examples Of Seasons Used In Popular Fiction

1. The Lion, The Witch And The Wardrobe by C. S. Lewis

Season: Winter and spring—Narnia is trapped in an endless winter under the White Witch’s rule. The arrival of spring signals the return of hope and the defeat of evil. The changing seasons are part of the novel’s symbolism.

2. The Great Gatsby by F. Scott Fitzgerald

Season: Summer and autumn—Fitzgerald uses summer heat to intensify the tension between Gatsby, Daisy, and Tom. The change to autumn reflects the decline of Gatsby’s dreams and the end of his hopes.

3. The Secret Garden by Frances Hodgson Burnett

Season: Winter and spring—Mary Lennox arrives at Misselthwaite Manor in a bleak, wintry landscape. As the garden comes back to life in spring, Mary and the people around her begin to change. The garden’s renewal mirrors their emotional growth.

4. A Christmas Carol by Charles Dickens

Season: Winter—Dickens uses the bitter cold to reflect Scrooge’s emotional coldness and lack of compassion. The warmth of Christmas, particularly in the Cratchit household, provides a contrast and reinforces the themes of generosity and human connection.

5. Little Women by Louisa May Alcott

Season: The changing seasons—The seasons help mark the passage of time as the March sisters grow up. Winter and Christmas establish the family’s domestic traditions, while the changing seasons reflect the girls’ changing lives, relationships, and ambitions.

The Last Word

The seasons are more than a backdrop. They can influence your characters’ moods, create conflict, and help move your plot forward. Think about the role the weather plays in your favourite stories. Then ask yourself: what could a change in season bring to yours?

P. S. If you’re looking for help with setting and descriptions, buy our Setting Up The Setting Workbook.

Source for image: Pexels

The post How To Use The Seasons In Your Writing appeared first on Writers Write.

Read the whole story
alvinashcraft
10 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Intelligence Engineering Is the New Business Advantage

1 Share

Four colleagues of different backgrounds smile as they build a layered structure from glowing blue and gold blocks

Why the future belongs to organizations that can systematically engineer, compose and improve intelligence.

Businesses Can Now Engineer Intelligence Itself

For decades, businesses built competitive advantage through software engineering.

They learned how to turn business capabilities into software, scale those capabilities through platforms, and create new value through digital transformation.

Now we’re entering a new era. Businesses can engineer intelligence itself.

They can capture expertise, compose reasoning capabilities, scale judgment, orchestrate specialized agents and continuously improve how intelligence is applied across the business.

With AI, you get access to intelligence. With Intelligence Engineering, you can turn that intelligence into a durable competitive advantage. That’s a much bigger opportunity.

The businesses that win in the Age of AI won’t simply be the ones that use intelligence. They’ll be the ones that get exceptionally good at engineering it.


The Changing Basis of Competitive Advantage

The changing basis of competitive advantage
Industrial AdvantageScale physical productionMachines · Factories · Supply chains
Information AdvantageScale access to informationDatabases · Networks · Internet
Digital AdvantageScale business capabilitiesSoftware · Platforms · Ecosystems
AI AdvantageScale access to intelligenceModels · Copilots · Agents
Intelligence Engineering AdvantageScale the ability to create value with intelligenceKnowledge · Skills · Models · Orchestration · Learning
An illustrative lens on the changing sources of business advantage.

AI is democratizing access to intelligence. But access to intelligence alone won’t create a durable competitive advantage.

You build the new business advantage by systematically capturing, specializing, composing, orchestrating, applying and continuously improving intelligence.

Intelligence Engineering is how businesses turn increasingly accessible AI into distinctive, proprietary and compounding business capabilities.


From Accessing Intelligence to Engineering It

  • From accessing intelligence to engineering intelligence.
  • From adopting AI tools to building organizational capabilities.
  • From creating individual agents to architecting intelligence systems.
  • From improving productivity to reimagining value creation.
  • From renting intelligence to building durable business assets.
  • From one-time improvements to compounding competitive advantage.

From AI Adoption to Intelligence Engineering

AI adoption Intelligence Engineering
Use intelligence Engineer intelligence
Deploy AI tools Build intelligence capabilities
Write better prompts Capture reusable expertise
Build individual agents Compose intelligence systems
Automate tasks Reimagine value creation
Select powerful models Architect the right intelligence
Improve individual productivity Improve organizational capability
Rent intelligence Build proprietary intelligence assets
Measure AI usage Measure business impact
Run AI experiments Build a compounding advantage

This is the distinction that I think many leaders are missing. They’re focused on adopting AI when the bigger opportunity is building a business that becomes systematically more intelligent.


Engineer Your Intelligence Advantage

The Intelligence Engineering Stack shows you where and how you can build your advantage.

The Intelligence Engineering Stack
Business ValueOutcomes, experiences and decisions
Intelligence OrchestrationAgents, workflows and collaboration
Intelligence GovernanceHarnesses, identity and evaluation
Context ArchitectureKnowledge, semantics and context platforms
Intelligence ModelsLLMs, DSLMs, SLMs, LQMs and world models
Intelligence InfrastructureCompute, security and sovereignty
An architectural framework for engineering enterprise intelligence.

With this stack, you can see beyond the models. You can see where to build proprietary capabilities that competitors can’t easily replicate.


Where the Real Competitive Advantage Lives

Capability Business advantage
Proprietary knowledge Know things competitors don't.
Context architecture Apply knowledge with greater relevance and precision.
Playbooks Replicate your best ways of working.
Specialized intelligence Solve domain problems more effectively.
Reusable skills Scale expertise across the organization.
Intelligence orchestration Combine capabilities to solve more complex problems.
Intelligence governance Scale autonomy with confidence.
Continuous learning Improve capabilities faster than competitors.
Model independence Adopt better intelligence as it becomes available.

The foundation models will continue to improve. Competitors will have access to many of the same models.

But they won’t necessarily have access to your knowledge, your expertise, your customer understanding, your proven methods or your architecture for putting it all to work. Those are assets you can build, own and compound.

Own your capabilities.

Rent your compute.

Choose your intelligence.

Build durable assets while retaining technology flexibility.


The Intelligence Engineering Flywheel

The Intelligence Engineering Flywheel

CompoundingIntelligenceAdvantageCaptureExpertiseEngineerCapabilitiesComposeIntelligenceApply toBusiness ValueEvaluateResultsLearn andImprove

Turn today’s experience into tomorrow’s intelligence capabilities.

Imagine a business that turns every successful customer engagement, innovation experiment, sales conversation and operational breakthrough into better intelligence capabilities.

The business doesn’t just get results from intelligence. It gets better at getting results. That’s the flywheel.


See AI Differently

Instead of asking, “How can we use more AI?” start asking, “How can we engineer intelligence into a sustainable business advantage?”

The thesisIntelligence Engineering Is the New Business AdvantageThe changing basis of competitive advantage.
The strategyOwn your capabilities. Rent your compute. Choose your intelligence.Build durable assets while retaining technology flexibility.
The outcomeCompounding Intelligence AdvantageBuild a business that gets better at creating value over time.

AI is a technology. Intelligence Engineering is a discipline. Business advantage is the outcome.


That’s the business case. In the companion article, Intelligence Engineering, you can see how to use what software architects learned over decades to design better AI.

The post Intelligence Engineering Is the New Business Advantage appeared first on JD Meier.

Read the whole story
alvinashcraft
10 hours ago
reply
Pennsylvania, USA
Share this story
Delete

Random.Code() - Handling Non-Public Types in SaferAccessors, Part 6

1 Share
From: Jason Bock
Duration: 1:03:21
Views: 5

This will be the final stream on this feature, even if I don't finish it 100%. At this point, I think I have most of it done, just need to test a couple of things and make some other changes, but I'm seeing [UnsafeAccessorType] in my dreams and that's not a good thing. Time to move on!

https://github.com/JasonBock/SaferAccessors/issues/6

#dotnet #csharp

Read the whole story
alvinashcraft
18 hours ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories