Skip to content

JP2Grok: support native Grok decompression of vsicurl files#14333

Open
boxerab wants to merge 1 commit intoOSGeo:masterfrom
boxerab:grok_vsicurl
Open

JP2Grok: support native Grok decompression of vsicurl files#14333
boxerab wants to merge 1 commit intoOSGeo:masterfrom
boxerab:grok_vsicurl

Conversation

@boxerab
Copy link
Copy Markdown
Contributor

@boxerab boxerab commented Apr 11, 2026

What does this PR do?

@rouault will enjoy this minimal PR : allow JP2Grok driver to use native Grok decompression for vsicurl files

AI tool usage

  • AI supported my development of this PR.

Tasklist

Comment thread frmts/grok/grkdatasetbase.h Outdated
@boxerab boxerab force-pushed the grok_vsicurl branch 3 times, most recently from 5cc6aa9 to d40ef10 Compare April 12, 2026 09:37
Copy link
Copy Markdown
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be properly rebased on top of latest master to solve merge conflict

I do believe that the network integration is fragile, and could cause headaches to users that use a GDAL networking option (or S3 authentication scheme) that isn't translated into Grok. I would certainly have strong reservations if Grok was a default driver.

Comment thread frmts/grok/grkdatasetbase.h
@boxerab boxerab force-pushed the grok_vsicurl branch 3 times, most recently from d0b4dac to 5392425 Compare April 12, 2026 16:37
@rouault
Copy link
Copy Markdown
Member

rouault commented Apr 12, 2026

Aaron, I'm giving up. I'll stop reviewing your PRs. I just can't psychology deal with being at the receiving end of LLM generated PRs. I don't know how to explain it, but it makes me mentally very uncomfortable, and it is exhausting. If another maintainer feels up for the task, fine to them.

@rouault rouault added the AI assisted⚠️ AI assisted coding involved. Review with extreme scepticism. label Apr 12, 2026
@aaron-boxer
Copy link
Copy Markdown

Aaron, I'm giving up. I'll stop reviewing your PRs. I just can't psychology deal with being at the receiving end of LLM generated PRs. I don't know how to explain it, but it makes me mentally very uncomfortable, and it is exhausting. If another maintainer feels up for the task, fine to them.

No problem, I understand. I will not be making any more AI assisted PRs for this driver.
How about we wait a few weeks and then merge this one as it is already written with passing tests ?

@boxerab boxerab force-pushed the grok_vsicurl branch 2 times, most recently from 0d1f19b to 7c0cfe0 Compare May 2, 2026 20:08
@boxerab
Copy link
Copy Markdown
Contributor Author

boxerab commented May 2, 2026

Hello again @rouault , hope all is well. Three weeks have passed since opening this relatively small PR - half of the changes are unit tests, all passing. The feature is a useful one IMHO as it allows Grok to efficiently handle more network files, and a conservative approach is taken for different auth options - those unsupported by Grok will trigger GDAL VSILFILE handling via callback.

Please consider accepting this one. 🙏

@rouault
Copy link
Copy Markdown
Member

rouault commented May 7, 2026

I'm not convinced that letting Grok handle I/O is the way to go. It will ultimately lead to issues similar to #14508 where there's a discrepancy between the library re-implementation of the GDAL protocol.
Maybe the thing to explore would be to identify what would be missing in GDAL VSIVirtualHandle , if anything is missing, and improve the brige with Grok I/O layer

@boxerab
Copy link
Copy Markdown
Contributor Author

boxerab commented May 8, 2026

I'm not convinced that letting Grok handle I/O is the way to go. It will ultimately lead to issues similar to #14508 where there's a discrepancy between the library re-implementation of the GDAL protocol. Maybe the thing to explore would be to identify what would be missing in GDAL VSIVirtualHandle , if anything is missing, and improve the brige with Grok I/O layer

agree, we don't want to have more issues like #14508.

The way IO currently works is that GDAL manages authentication, and then passes the url and any auth information like custom headers to Grok, which then reads the file. In the case of network files, it uses libcurl directly in a way that is customized for J2K file format, making use of the main header and TLM markers if present to very efficiently pull the data, using range requests for tiles. It's not re-implementing the GDAL protocol, which is more general.

Replicating the Grok https fetcher in GDAL would be a lot of work and would only be suitable for one format : J2K. Not sure this is worth it, IMHO.

@rouault
Copy link
Copy Markdown
Member

rouault commented May 8, 2026

if present to very efficiently pull the data, using range requests for tiles

That's vague. Concretely, what type of calls is missing in VSIVirtualHandle to implement efficient reading from grok ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted⚠️ AI assisted coding involved. Review with extreme scepticism.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants