Back to walidsassi.com
A regression line learned in PyTorch, converted and running on an iPhone with Core AI

Core AI & PyTorch, Part 1: Understand Before You Integrate

Before converting a PyTorch model to Apple Core AI, understand what a model actually is. Rules and data, features and labels, the mean squared error, one step of gradient descent computed by hand, regression and classification, training and inference, plus an interactive playground.

November 14, 2026 · 22 min · Walid Sassi
Scoring a multimodal receipt extraction with code metrics and a model judge

Scoring What the Model Read: Metrics, a Judge, and 21 Receipts

Comparing store names with == fails almost every receipt. Here are the three code metrics and the model judge that turn a photo extraction into numbers, plus the results on 21 real receipts and the error patterns hiding behind them.

September 12, 2026 · 10 min · Walid Sassi
Reading a store receipt photo with Apple's multimodal on-device model

When the Model Can See: Reading Receipts with Multimodal Prompting

Multimodal prompting collapses OCR and understanding into one call. Here is the feature: a @Generable Receipt, one carefully shaped session with an image Attachment, and the photo dataset that has to be transcribed by hand before anything can be measured.

September 12, 2026 · 9 min · Walid Sassi

Mobile System Design Interview

Swift Academy Podcast · Series A mock-interview series with Artem Mirzabekian, Lead iOS Engineer. Real mobile system design problems, solved out loud the way a senior interview actually runs, with the roles swapping between episodes. Two episodes published. 🎧 Swift Academy Podcast · Series · 2 episodes · Requirements • APIs • Domain • Architecture “Most system design conversations stop at the box diagram. The interesting part starts after: what happens when the cursor is stale, the receipt URL has expired, and the user is on a train with no signal.” The premise of this series What This Series Is Mobile system design is usually taught as a whiteboard ritual, or reduced to an argument about architectural acronyms. This series does the opposite. Each episode takes one realistic feature and designs it properly, out loud, with the trade-offs left visible instead of tidied away. Episode 1 tackles an e-commerce home page; episode 2, broken down below, tackles the transaction history of a banking app. The feature is deliberately unglamorous and deliberately hard. A transaction list looks trivial until you hold it to production standards: thousands of records, a server that keeps changing beneath you, a search field, filters, receipts behind expiring URLs, and a security team with a firm opinion about what may be written to disk. Every decision in it has a cost, and the point of the series is to name that cost rather than hide it. Inside Episode 2: Designing a Transaction History Paging Through a List That Will Not Sit Still Offset pagination breaks the moment records are inserted while the user scrolls: rows repeat, rows vanish, and nobody notices until it reaches production. Cursor-based pagination is the answer, and the design work is in the details around it. Why offset paging is unsafe against a mutating dataset, and what the user actually sees when it fails Cursor design: opaque tokens, stability guarantees, and what to do when the server invalidates one mid-scroll Prefetch thresholds, in-flight request de-duplication, and cancelling work the user has scrolled past Where the cursor lives, and why it does not belong in the view Search and Filter Without Fighting the Pagination Search and filters are where a clean pagination design usually falls apart, because each one produces a different result set with its own cursor and its own lifecycle. Server-side versus client-side filtering, and the point where the dataset makes the choice for you Debouncing, cancellation, and keeping the visible list coherent while a query is in flight Composing filters, date ranges, categories, amounts, without a combinatorial explosion of endpoints Resetting or preserving scroll position when the query changes States and Freshness “Loading, loaded, error” is not a state model, it is a placeholder for one. Real screens are simultaneously stale, refreshing, partially loaded, and partially failed. Modelling loading, empty, partial, stale, refreshing and failed as a type the compiler can check Distinguishing an empty list from a list that has not loaded, the single most common bug in this feature Freshness policy: what to show immediately from cache, what to revalidate, and what to block on Error recovery that does not discard the data the user is already reading The Offline Versus Security Debate This is the part of the series with no clean answer, which is exactly why it is worth recording. Offline access argues for caching transactions on device. The security posture of a banking app argues against writing financial history to disk at all. The real threat model: device theft, backups, jailbreak, shared devices, and what each one actually exposes What a partial answer looks like, caching metadata but not amounts, or encrypting with a key held in the Secure Enclave Cache lifetime tied to session lifetime, and what must be destroyed at logout Why this decision belongs to the product and the security team, and what the architecture must do to keep it reversible Expiring Receipt URLs Receipts are served behind short-lived signed URLs. That single constraint reaches surprisingly far into the design. Why a signed URL must never be persisted, and what to persist instead Fetching the URL lazily at the moment of use, and handling expiry between tap and load Retry and re-signing flows that do not strand the user on a broken screen What this implies for share sheets, deep links, and anything that outlives the session SwiftUI, UIKit, and the Layers Underneath The UI framework is the least interesting decision on this list, and the one people argue about most. We treat it as an implementation detail and spend the time on the layering that survives either choice. Where SwiftUI is a clear win for this screen, and where UIKit still holds an advantage on large lists Interoperating deliberately rather than accidentally, and keeping the boundary in one place ViewModel, Presenter, Service, UseCase: what each layer owns, and the concrete test you apply to decide where a piece of logic belongs Keeping the pagination, freshness and caching policy testable without a running UI What This Series Deliberately Avoids No MVVM versus VIPER debate. It is a distraction from system design. We talk about responsibilities and boundaries; name the resulting pattern whatever your team already calls it. No whiteboard theatre. Every decision is tied to a failure mode you can actually observe in a shipped app. No single right answer. Where the trade-off is genuine, it is left as a trade-off, with the cost of each side stated plainly. About the Guest Artem Mirzabekian Lead iOS Engineer at Sovcombank • 10+ years scaling mobile platforms Artem leads iOS engineering at Sovcombank, where transaction history is not a hypothetical exercise but a screen used by millions of customers under real regulatory and security constraints. His work spans iOS architecture, Swift, SwiftUI, system design and technical leadership, with a decade of experience scaling mobile platforms and the teams that build them. Watch the Series Episode 1, Designing an E-Commerce Home Page The opening episode takes one of the most common mobile engineering scenarios and runs it as a real interview: clarifying requirements, defining the APIs and data models, and arriving at an architecture that scales. Artem published a companion repository with a working implementation of the ideas discussed, typed backend-driven sections, defensive DTO mapping, cache-first loading, visibility-based analytics, optimistic add-to-cart, and an image pipeline with downsampling and request de-duplication. 🎥 Watch episode 1 · 95 min 📦 Companion repository Episode 2, Designing a Banking Transactions Screen The second episode swaps the roles: this time Walid is the candidate and Artem the interviewer. It is the session the breakdown below is drawn from, working through the transaction history of a mobile banking application from requirements to architecture. 🎥 Watch episode 2 🎬 Full playlist on YouTube 🎧 Follow on Apple Podcasts Go Deeper: AI-Driven Swift Architecture The layering this series relies on, use cases, services, and the boundaries that keep a feature testable, is the subject of the book. If the sessions leave you wanting the full treatment of Clean Architecture, TDD and modular Swift on production codebases, that is where to continue. 📘 Read about the book

September 5, 2026 · 6 min · Walid Sassi

Swift Academy Podcast, Season 1

September 5, 2026 · 0 min · Walid Sassi

Swift Academy Podcast, Season 2

September 5, 2026 · 0 min · Walid Sassi

Swift Academy Podcast, Season 3

September 5, 2026 · 0 min · Walid Sassi

Performance Is More Than Just Speed with Artem Mirzabekian and Bogdan Poplauschi

Swift Academy Podcast, Episode 2, Season 3 Performance Is More Than Just Speed Part two with Artem Mirzabekian and Bogdan Poplauschi, going underneath the abstractions: Swift Concurrency migration, the cost of the tools we use daily, and why application launch is an architecture problem. August 23, 2026 🎧 Swift Academy Podcast · Episode 2, Season 3 • Part 2 of 2 · Concurrency • Abstraction • App Launch Watch the Episode The Hidden Cost of the Tools We Use Daily Part one challenged the myths. This one goes underneath them, into Swift Concurrency, abstractions, architecture, application launch, frameworks and dependencies. The connecting idea is that performance work rarely starts with performance. Migrating an existing codebase to Swift Concurrency tends to expose architectural weaknesses that were always there, and a dependency graph that grew quietly for two years turns into a launch time nobody can explain. What We Go Through Migrating an existing codebase to Swift Concurrency The migration is where most teams meet the model properly for the first time, and where the wrong mental model gets expensive. Migration pitfalls, and the mental models that cause them What async/await really means for execution, as opposed to what people assume Common Swift Concurrency anti-patterns that survive a migration The impact of @MainActor on CPU-heavy work When Task.detached becomes a problem rather than a solution Why blocking asynchronous work leads to deadlocks How adopting concurrency exposes architectural weaknesses that predate it Abstraction versus performance Abstraction makes code easier to read, test and maintain. It also hides what the application is actually doing, and at some point that stops being a good trade. Balancing clarity, maintainability, abstraction and performance rather than picking one Why understanding what sits underneath an abstraction is part of using it well Where protocols help the architecture and where they quietly cost something Application launch and the dependency graph Why a complex dependency graph slows down launch, and how that happens gradually The hidden cost of frameworks and of the tools used every day Treating launch time as an architectural property rather than a metric to optimise at the end About the Guests Artem Mirzabekian & Bogdan Poplauschi Lead iOS Engineer at Sovcombank • Staff Engineer, iOS Architecture & CI/CD Artem co-hosts the Mobile System Design Interview series. Bogdan appeared twice in Season 1, on taming legacy code and on refactoring in practice, and both reviewed AI Driven Swift Architecture. Key Takeaways A concurrency migration is an architecture review in disguise. The warnings you cannot silence are usually pointing at a real design problem. @MainActor is not a safety blanket. Putting CPU-heavy work behind it moves the cost onto the frame budget. Task.detached is rarely the answer. Reach for it deliberately, not to make a warning disappear. Abstractions have a price. Use them, but know what they are doing underneath before they become the bottleneck. Launch time is architectural. A dependency graph that grew unchecked cannot be optimised away at the end. Resources & Links 🎥 Season 3 Episode 2, Watch on YouTube 🎧 Part 1, Modern iOS Performance Myths 🧵 Swift Concurrency Explained with Matt Massicotte Listen & Subscribe If your team is midway through a Swift 6 migration and the warnings are multiplying, this pair of episodes is the one to share. 🎥 Watch on YouTube 🎧 Listen on Apple Podcasts ☕ Support the Podcast

August 23, 2026 · 3 min · Walid Sassi
Refining a model-as-judge evaluator in Apple's Evaluations framework

Two Refinements That Sharpen a Model-as-Judge Evaluator

Two refinements to the NeighborhoodCoherence judge from part two: pass the metric name straight to ModelJudgeEvaluator to drop the ScoreDimension boilerplate, and shape what the judge actually reads with evaluationTarget and reference.

August 19, 2026 · 7 min · Walid Sassi
When code can't judge quality: model-as-judge evaluators in Swift

When Code Can't Judge Quality: Model-as-Judge Evaluators in Apple's Evaluations Framework

Code-based evaluators can only measure what code can measure. This companion article goes deep on ModelJudgeEvaluator: choosing a scoring scale, writing scoring levels that actually work, and wiring a model-as-judge into the TripPlanner evaluation from part one.

July 26, 2026 · 7 min · Walid Sassi