Testing the Coding Ability of a New-Generation LLM: Building a Desktop Tool in Practice
This article evaluates whether code generated by a new-generation open-source large language model (internally referred to as GLM-5.3) can pass validation and run immediately, especially in desktop scenarios involving concurrency, exception handling, and status feedback. Using a real-world test that deliberately stacks multiple constraints, it shows how keeping long-running tasks off the main thread prevents UI freezes, highlights robustness details the model added on its own, and provides a reusable prompt template and a four-step acceptance checklist for turning model output into deliverable engineering results.
1. Background: The Gap Between “Writing Code” and “Code That Runs”
Recent news about a new-generation open-source large language model (internally referred to as GLM-5.3) has sparked discussion in the developer community. Public benchmarks and the official release statements indicate a significant improvement in coding ability over the previous generation, approaching the level of the leading closed-source models. For developers, however, a benchmark score is only one reference point. The question that really determines adoption is: Can the generated code pass validation on the first attempt and run directly? In desktop applications that involve concurrency, exceptions, and status feedback, will it fall into classic traps such as a frozen interface?
This article uses a real-world test as its main thread and abstracts a reusable engineering method from it. Rather than evaluating any specific product, it focuses on how to use prompts to constrain model capabilities into deliverable engineering results.
2. Test Design: Deliberately Making the Requirements “Difficult”
An effective capability test must increase requirement density. This test intentionally layered multiple dimensions of constraints:
- The input side supports common video container formats, and the output side supports mainstream audio encodings such as MP3 and WAV;
- The tech stack is limited to Python and tkinter;
- The interface must include a file import list and an input/output format settings area;
- The functional loop covers importing, running the conversion, and exiting;
- Non-functional requirements include a progress bar, a status bar, and error messages, and the interface must not freeze during conversion.
The last item is the key dividing line. The main thread of a GUI program handles both the event loop and rendering. Once a time-consuming transcoding task runs on the main thread, the event loop is blocked and the window becomes “not responding.” Many lazy generated solutions lose points here, which makes it an effective probe of a model’s engineering understanding.
3. The Correct Architecture: Moving Time-Consuming Tasks Off the Main Thread
The reason the model’s implementation is usable is that it proactively chose an asynchronous approach. In engineering practice, there are usually three paths:
threadingplus a queue for progress reporting: lightweight with few dependencies, suitable for local desktop tools;concurrent.futures.ThreadPoolExecutor: convenient for controlling concurrency and scheduling batch tasks;- A separate child process that calls an external transcoding program: the best isolation, though progress must be parsed from standard output.
A schematic structure is shown below:
import threading, queueclass Worker(threading.Thread):def __init__(self, tasks, q):super().__init__(daemon=True)self.tasks, self.q = tasks, qdef run(self):while True:item = self.q.get()if item is None:breaktry:# Call the external transcoding command and parse progress outputself.q.put(("progress", item, 100))except Exception as e:self.q.put(("error", item, str(e)))finally:self.q.task_done()
On the interface side, a timer periodically reads the queue and only updates widget state without performing blocking operations:
def poll(self):while True:try:kind, name, payload = self.q.get_nowait()except queue.Empty:breakif kind == "error":self.status.set(f"{name} failed: {payload}")else:self.progress["value"] = payloadself.after(100, self.poll)
There are three key points: time-consuming logic is completely separated from the UI thread; progress flows one way through a thread-safe queue; and all UI updates are executed back on the main thread.
4. Additional Engineering Details the Model Filled In
What is noteworthy is the robustness design the model added without being asked, which is exactly the part most easily overlooked in real projects:
- Recursive directory scanning, supporting batch queuing of files in subfolders;
- Format whitelist completion, covering common video and audio extensions to avoid wrong selections;
- Automatic sequence numbers for duplicate output names, preventing silent overwriting of user files;
- Checking whether the external transcoding component is available before running, giving clear guidance when it is missing instead of throwing a stack trace;
- Task-level exception isolation, so a single file failure does not interrupt the whole batch.
These behaviors show that the model has a certain tendency toward “default best practices,” but boundary conditions still require manual review.
5. A Reusable Prompt and Acceptance Method
A structured prompt template for improving the first-pass success rate:
Role: Senior desktop application developerTech stack: Python 3 + tkinter; no heavy frameworks allowedFeatures: Batch audio/video extraction; input a directory or files; output MP3/WAVNon-functional: Time-consuming tasks must be moved off the main thread; provide a progress bar and status bar; errors need readable messagesDeliverable: Complete runnable single-file code + dependency notes + usage stepsConstraints: Do not overwrite existing files; give a friendly message when external dependencies are missing
Acceptance is recommended in four steps: first run a syntax compilation check; then run a small sample in an empty directory; next construct abnormal inputs such as extremely long file names, directories without permissions, and corrupted files; finally observe whether the interface stays responsive during long batch tasks. If stronger observability is needed on the enterprise side, runtime logs can be connected to a general logging service, with monitoring and alerts covering the task failure rate; the model invocation pipeline itself can also be hosted on relevant general capabilities from Baidu AI Cloud.
6. Conclusion
Under structured requirements, the new-generation model can already produce desktop application code that is “close to deliverable,” performing steadily on engineering constraints such as concurrency and exception handling. However, benchmark improvement does not mean zero-cost adoption. Developers should still focus on the precision of requirement descriptions, explicit constraints on the asynchronous architecture, and systematic acceptance.
