How to Evaluate AI Coding Models on Complex Engineering Tasks

    A practical method for evaluating AI coding models on complex infrastructure work, using upstream HTTP/2 multiplexing in a reverse proxy as the case study. It covers system invariants, failure paths, code review, design quality, verification, and gradual rollout, and ends with a seven-dimension evaluation framework.

    In infrastructure and backend engineering, judging an AI coding model cannot rely only on how fast it writes code, or on whether it produces code that runs. The more useful questions are these: When faced with a high-complexity, tightly constrained, long-chain feature task, can the model understand the system’s invariants? Can it propose a maintainable design? Can it find cross-module issues during code review? And can the engineering team verify and constrain its output at low cost? This article uses “adding upstream HTTP/2 multiplexing to a reverse proxy” as an abstract case and discusses a reusable evaluation method.

    1. Why Complex Engineering Tasks Reveal Real Capability

    Upstream HTTP/2 multiplexing in a reverse proxy is not an isolated function. It involves at least connection setup and reuse, concurrent stream limits, flow-control windows, request and response mapping, timeouts and cancellation, error propagation, connection pool health checks, graceful shutdown, and observability. When a developer asks a model to implement this feature, the request is not “write a function that opens a stream.” The developer is asking the model to understand how these parts constrain one another.

    Such tasks share several traits. First, the state machine is complex, so a locally correct change can break global concurrency. Second, there are many failure paths. Timeouts, resets, connection exhaustion, and peer-side closure all need consistent handling. Third, maintainability matters, because the team must maintain the code over time and roll it out gradually. Fourth, verification is expensive. Reading generated code alone rarely confirms whether resources leak or races exist. For this reason, evaluating models on tasks like this reveals more about their real ability in complex code understanding, design, and defect detection than simple CRUD work does.

    2. The Value and Limits of Faster Output

    When an AI coding model’s output throughput rises significantly, the most immediate change is the pace of interaction. Work that once required a long wait for a complete proposal now produces a first draft, test suggestions, and refactoring ideas much sooner. For tasks that need many iterations, faster output makes it more practical to have the model try several approaches.

    Speed alone, however, does not mean quality. Fast output may mean the model reaches a wrong direction sooner, or that it performs less self-checking. When evaluating a model, weigh speed gains against verification cost together. If generation becomes several times faster but each result needs heavy manual rework, overall efficiency may not improve. If faster generation does not reduce the model’s ability to understand complex code, locate problems, and design solutions, and it even catches issues that were missed earlier, then capability is improving alongside speed.

    In practice, you can spot-check key decision points. Do not require long reasoning chains. Instead, check whether the model clearly states its connection reuse strategy, concurrency limit, error propagation path, rollback method, and test plan. A fast model that gives consistent answers on these points is worth trusting with higher-risk tasks.

    3. Case Study: Key Challenges of Upstream HTTP/2 Multiplexing

    In a reverse proxy, upstream HTTP/2 multiplexing must let many requests share one connection without blocking each other. When evaluating an AI coding model, check whether it proactively identifies the following constraints:

    • How the connection pool groups connections by upstream target, protocol configuration, and health status.
    • How the number of concurrent streams per connection is limited, and what happens at the limit: queue the request, open a new connection, or fail fast.
    • How flow-control windows affect sending request bodies and reading response bodies, and how to avoid deadlocks.
    • How request cancellation and timeouts map to stream resets, and how resources are released correctly.
    • How existing and new streams are handled when the peer sends a close notification.
    • How connection-level errors are distinguished from stream-level errors, so that one failed stream does not take down the whole connection.
    • Whether observability metrics cover connection count, active streams, queue wait time, failure reasons, and retry counts.
    • How graceful shutdown stops accepting new streams and waits for in-flight streams to finish.

    A sound design covers not only the happy path but also failure paths and resource ownership. The following pseudocode is illustrative only. It focuses on connection selection, concurrency limits, and resource release, not on any specific product’s interface:

    1. function acquire_stream(upstream):
    2. conn = pool.get_or_create(upstream)
    3. if conn.active_streams >= conn.max_concurrent_streams:
    4. conn = pool.open_new(upstream)
    5. stream = conn.open_stream()
    6. return stream
    7. function release_stream(stream):
    8. stream.close()
    9. conn = stream.owner
    10. conn.active_streams -= 1
    11. if conn.should_close():
    12. pool.remove(conn)

    When evaluating the output, ask these questions: What happens if open_new fails? If a stream is cancelled while it is sending its request body, is the connection still usable? If the peer closes the connection, how are queued requests woken up? These questions distinguish a model’s depth of engineering understanding better than whether the code looks complete.

    4. Incremental Value in Code Review

    An AI coding model’s value in code review should not be judged only by whether it flags naming or formatting issues. A better test is whether it finds cross-module invariant violations, resource leaks, race conditions, and missed error paths. For the upstream HTTP/2 multiplexing task, you can build samples with injected defects, such as omitting stream release, retrying all streams after a connection-level error, or creating new streams after a close notification. Then observe whether the model can locate each problem and propose a fix.

    High-quality review output usually has three traits. First, it identifies the specific path that has the problem and the scope of its impact. Second, when it proposes a fix, it explains the trade-offs rather than offering only a patch. Third, it suggests verifiable tests, such as concurrent cancellation tests, connection exhaustion tests, peer closure tests, and long-running load tests. If a model finds issues that earlier stages missed, it adds value in understanding complex code. If it only repeats surface-level problems, it is not suitable for high-risk review.

    5. Design Capability: From Working Code to Maintainable Code

    For the same feature, design quality often separates one solution from another. When evaluating an AI coding model, check whether it does the following:

    • Keeps module boundaries clear, with the connection pool, stream scheduling, and protocol encoding and decoding each owning a distinct responsibility.
    • Defines a clear concurrency model and avoids unnecessary global locks.
    • Makes failure recovery rollback-capable and lets configuration changes take effect gradually.
    • Builds observability in from the start instead of adding logs after the fact.
    • Maintains a complete test strategy covering unit, integration, concurrency, and fault-injection tests.

    Better designs are usually not more complex. They express more constraints with fewer states. For example, “can this connection be reused” can reduce to a health-state check in the pool. “Can a stream be created” can reduce to a concurrency quota check. “Is the request complete” can reduce to unified lifecycle management. When a model explains these boundaries and trade-offs in its design, it participates in engineering decisions rather than only generating code.

    6. Engineering Rollout: Constraining Model Output with Tests and Gradual Release

    No matter how good a model is, high-risk infrastructure changes cannot skip verification. Build four layers of constraints:

    1. Static analysis and coding standards, which catch obvious resource leaks and incorrect API usage.
    2. Unit and integration tests, covering connection reuse, concurrency limits, cancellation and timeouts, and error propagation.
    3. Fault injection and load testing, which verify peer closure, connection exhaustion, and stability over long runs.
    4. Gradual release with a rollback plan. Enable the change first on a small share of upstream traffic, and monitor connection count, active streams, failure rate, and tail latency.

    Human review should focus on high-risk decisions: the concurrency model, resource ownership, retry boundaries, and the shutdown flow. Models can speed up drafts, review, and test generation, but the engineering team remains responsible for the outcome.

    7. Conclusion: Building a Reusable Evaluation Matrix

    To evaluate AI coding models, use seven dimensions: speed, correctness, complex code understanding, design quality, incremental review value, verifiability, and risk controllability. Speed determines interaction efficiency. Correctness and verifiability determine whether the output can ship. Complex code understanding and design determine the model’s ceiling. Incremental review value determines whether the model can join a high-quality development process. Only by repeatedly recording successful and failed patterns on real, difficult tasks, and building a reusable evaluation set, can a team judge whether a model truly improves engineering efficiency rather than making code generation merely look faster.