I call queryPortalVisibility() on a background thread and I was wondering if you could give me any idea what kind of stack size I should be using in a large scene? I'm using 512K and it seems to work but want to be sure.
You should be able to go with much smaller stack than that. Almost all of the variables are allocated from a scratch pool, not from the stack. I wouldn't be too surprised if a 16K stack would be enough.
Also, if you find a stack size that works with most cases, you can be confident that it will work with any content. If not, you should file a bug.