Archive for May 15, 2025

Thursday, May 15, 2025

HDR in Forthcoming Halide 3

Ben Sandofsky (tweet, Hacker News):

Then the algorithms combined everything into a single “photo” that matches human vision… a photo that was useless, since computer screens couldn’t display HDR. So these researchers also came up with algorithms to squeeze HDR values onto an SDR screen, which they called “Tone Mapping.”

[…]

HDR and Deep Fusion require that the iPhone camera capture a burst of photos and stitch them together to preserve the best parts. Sometimes it goofs. Even when the algorithms behave, they come with tradeoffs.

[…]

After considerable research, experimentation, trial and error, we’ve arrived on a tone mapper that feels true to the dodging and burning of analog photography. What makes it unique? For starters, it’s derived from a single capture, as opposed to the multi-exposure approaches that sacrifice detail. While a single capture can’t reach the dynamic range of human vision, good sensors have dynamic range approaching film.

However, the best feature is that this tone mapping is off by default. If you come across a photo that feels like it could use a little highlight or shadow recovery, you can now hop into Halide’s updated Image Lab.

I’m still disappointed by the options that recent versions of the iOS Camera app offer here. With iPhone 13 and later, there seems to be no way to turn off Smart HDR. Enabling ProRAW may give more control for post-processing in Lightroom, but it still combines multiple captures into one.

I like that Lux is trying to address this with Halide, but I’m not sure this is the right solution for me. First, is the sensor really good enough to get all the needed data with one capture? Second, I don’t want to go through all the photos on my iPhone; I prefer to process them on my Mac.

Previously:

Microsoft Layoffs

Jordan Novet:

Microsoft on Tuesday said that it’s laying off 3% of employees across all levels, teams and geographies, affecting about 6,000 people.

[…]

The company reported better-than-expected results, with $25.8 billion in quarterly net income, and an upbeat forecast in late April.

[…]

In total, it’s likely Microsoft’s largest round of layoffs since the elimination of 10,000 roles in 2023. In January the company announced a small round of layoffs that were performance-based. These new job cuts are not related to performance, the spokesperson said.

Alex Halverson:

The Redmond-based software giant said Tuesday that the layoffs, which will affect almost 2,000 workers in Washington state, are meant in part to strip away layers of management and create more nimble teams.

[…]

Microsoft isn’t alone in this strategy. It’s the same reasoning Starbucks CEO Brian Niccol gave when Starbucks laid off more than 1,000 corporate workers and removed hundreds of open roles.Amazon CEO Andy Jassy said last year that the company was working to lower the manager-to-employee ratio.

[…]

But the company is pumping billions of those dollars into artificial intelligence infrastructure, namely data centers, that won’t make a return on investment in the immediate future.

[…]

Scott Hanselman, vice president of Microsoft’s developer community, wrote on LinkedIn that it was a “day with a lot of tears,” and the first time he’s had to lay people off to support business goals that weren’t his own.

Outlook Business (tweet):

Ron Buckton, a former senior software development engineer at Microsoft who contributed to the development of the TypeScript compiler and language service in native code, was among the 6,000 employees laid off by the company on Tuesday.

Buckton, who had served Microsoft for 18 years along with his team, helped TypeScript achieve a 10x speed boost in build times and editor responsiveness.

Rob Eisenberg:

Sadly, this is an example of my tweet from last week, showing just how little Microsoft understands the web; and now they are down yet another thought leader.

What they have done here is optimize for some short-term quarterly revenue goal, while completely wrecking their long-term technical strategy (which they may not even have…but that’s a whole different issue). This is all so common among Microsoft’s middle management layer (VP, CVP, etc.).

Dare Obasanjo:

Seeing a wave of posts about the layoffs at Microsoft and I’m deeply curious about the narrative. A few years ago you could blame ZIRP ending or COVID overhiring. A few months ago it was low performers.

What reason are employees being given now for layoffs after a record earnings quarter?

Rui Carmo:

Although I was not privy to any and the orgs affected are (so far) quite distant from my endeavors, the article rings true where it points to post-pandemic growth spurts and long overdue org chart calibration as key drivers–although I’m positive there will be the usual misinterpretations about AI “replacing” people and other such idiocy.

Previously:

2025 Six Colors Apple in the Enterprise Report Card

Jason Snell:

Of those expressing a preference, a third said they’d only be comfortable with allowing on-device running of AI models; nearly half said they’d be okay with on-device models and those that run in Apple’s Private Cloud Compute servers. Only 18% said they’d be comfortable with everything—on-device, Private Cloud Compute, and third-party AI in the broader cloud.

Finally, we asked our panel how they personally use AI technology in their own jobs. More than half answered in the affirmative, with 19% saying they use it quite a lot. For the other half, it’s a no—and for 16% it’s a hard no.

[…]

After a few years of consistent improvement, the score for Apple’s enterprise programs slid backward this year. Panelists praised incremental improvements to Apple Business/School Manager (ABM/SM), particularly around features like Activation Lock management and Managed Apple Accounts. But the lack of comprehensive APIs hinders automation and efficient management for large organizations. Documentation is seen as improving in some areas, but still needing more depth and consistency.

[…]

In a bit of a (not entirely unexpected) whiplash, the panel’s feelings about Apple’s software side diverge strongly from the praise given to hardware. This was the lowest score in the survey, with the biggest drop. Large sites and businesses were even more critical than the overall survey. A prevalent theme was a perceived decline in software quality (a “continued downward spiral”) and an increase in bugs and instability in recent macOS and iOS releases.

Compared with the regular report card, this panel seems much more negative on software quality.

Jason Snell:

But if you want to read all the comments from the panelists who were willing to share in public—all 25,000 words of it—who are we to stand in your way?

Previously:

SQLite Databases in App Group Containers (Don’t)

Brent Simmons (2020):

The crash logs were not identical, but they had this same thing:

Namespace RUNNINGBOARD, Code 0xdead10cc

This meant that the system was killing the app because, after the background task was complete, the app still had references to a SQLite database (or sometimes another file).

Apple:

0xdead10cc (3735883980) — pronounced “dead lock”

The operating system terminated the app because it held on to a file lock or SQLite database lock during suspension. Request additional background execution time on the main thread with beginBackgroundTask(withName:expirationHandler:). Make this request well before starting to write to the file in order to complete those operations and relinquish the lock before the app suspends. In an app extension, use beginActivity(options:reason:) to manage this work.

Marco Arment:

Don’t keep the SQLite database in the shared container. You’ll never get rid of all of those crashes. Instead, communicate with extensions via other means than having them read/write the DB directly, such as Darwin notifications or writing plist files in the shared container.

[…]

I tried wrapping every SQLite query in a background task once to avoid this. A standard Overcast session may issue hundreds or thousands of database queries. I later found that apparently each one generates a process power assertion, the OS wasn’t made for that level of usage, and after some time, Springboard would crash.

There’s also the NSProcessInfo background-task thing that allegedly works in extensions, except that it doesn’t.

GRDB:

This guide describes a recommended setup that applies as soon as several processes want to access the same SQLite database. It complements the Concurrency guide, that you should read first.

On iOS for example, you can share database files between multiple processes by storing them in an App Group Container.

[…]

Post suspendNotification when the application is about to be suspended.

[…]

Once suspended, a database won’t acquire any new lock that could cause the 0xDEAD10CC exception.

In exchange, you will get SQLITE_INTERRUPT (code 9) or SQLITE_ABORT (code 4) errors, with messages “Database is suspended”, “Transaction was aborted”, or “interrupted”.

Gwendal Roué:

One of the difficulties lies in the OS apis, in order to detect when the app is about to get suspended, and when the app becomes able to acquire database locks again. See this forum thread with @justkwin.

The other difficulty is that if the app is writing (holding a lock) at the moment it is notified it will get suspended, then all it can do is aborting the write.

Ryan Ashcraft:

It’s a common problem developers face when building iOS apps: you have a SQLite database, possibly backed by Core Data, and you want to use it to support features in your app extensions, such as widgets and intents.

The problem has a common and seemingly simple answer: just move the database to an App Group container! It’s relatively straightforward, with plenty of StackOverflow answers and YouTube tutorials on the matter.

[…]

These mitigations may sound reasonable at first, but implementing all of them correctly and consistently is surprisingly difficult—especially for database-heavy apps like Foodnoms. Trust me—I’ve tried.

Beyond the complexity, you also lose flexibility with background execution. For example, features like HealthKit background delivery become harder to support reliably.

[…]

Instead of moving your database to a group container, use these techniques instead and keep the database inside your app’s documents directory.

He suggests writing data to JSON files and using multiple copies of the same intent. These seem like caveman solutions. iPhones now have super fast processors and more RAM than Macs did when the iPhone was first released. How many more years before they support a less brittle process model?

Previously:

Update (2025-05-15): Paulo Andrade:

I believe requiring app extensions to be a separate process to have been a bad decision from the get go. And there’s no excuse for it now. The fact the new App Intents can be handled in the main app is kind of proves my point. App extensions could just be a new window on the main app’s process.