Repository navigation
Conversation
|
@MarcelL94 Following up on my notes in the issue discussion Several of my open questions are answered by the code:
Still open from that list: the cold-cache run, a control flight without the prefetch, and the length of the pause from the memory give-back (the log line already records it, so just post the number). R6: my answers
To fix before review
The two load-ahead changes in commit 1 Suggestions for Sunday's flights
For the release notes, later
That's a lot of points, but most are small, and the foundation is solid. Good luck with the flights on Sunday. I'm looking forward to the numbers and the next round. 🛫 |
1950ea7 to
058c7db
Compare
…ve-back - R6: the 3 x 4 rule next to SceneryLoads and DsfTerrain in its own file; X-Plane's groundspeed and onground_any for the gate and the takeoff roll; the airports ordered by PrefetchPlanner.Select without motion (the climb keeps its own order). - flysimdev#30 item 1: SimBriefClient.Parse never throws on an unexpected shape; a throwing fetch is "no plan"; StopAsync logs a SimBrief failure and still disposes everything. - flysimdev#30 item 2 (H1): load-ahead outranks the departure, the departure the ground pre-warm, so the takeoff roll never drops load-ahead's request. - flysimdev#30 item 3: without mip streaming only the departure is built; documented and logged. - simbrief-max-mb is now simbrief-download-limit; the setup summary says "on", not the user. - The memory give-back waits for 10 s without reads or builds and logs the pause. - Tests for all of it; a log-filter in LoadMeasureTests no longer counts other tests' lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the thorough review! I've worked through your notes and force-pushed the branch, rebased on the current Commit structureNow five commits, each building with 0 warnings and passing all tests on its own (388 / 392 / 434 / 466 / 468):
R6
Your three points
Other changes
One request: CI hasn't run on this PR yet. The workflow is waiting for approval (fork PR from a first-time contributor). Could you approve it? |
Refactor only, no behaviour change: nothing calls them yet. SceneryLoads observes the DSF tiles X-Plane opens; TilesAround says which ones it opens around a place (three rows by four columns, leaning to the nearer half of the column, checked at EDDV). DsfTerrain reads a DSF's TERT table without reading the rest of the file. The SimBrief prefetch builds on both in the next commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est read Two changes to load-ahead for every flight, not only SimBrief ones: - A level asked for ahead on a texture with nothing yet (the flight-path prefetch) fetches its base tile first, in the base tiles' own places. Load-ahead skips a texture that is whole already, so without this the low-zoom base (far scenery, colour matching, the report's map) stayed empty there. If the base tile fails, the request goes instead of being tried every pass, and only real build starts count. - Nothing is fetched ahead coarser than X-Plane's smallest read: it reads the file's last 64 KB chunk, so it takes at least level 4 of a 4096 px texture. For ZL18 textures that is two levels finer than the base tile; fetching only the base tile made all 926 ZL18 textures at EDDV wait while X-Plane loaded them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Optional, off until a SimBrief username or Pilot ID is set (simbrief-user). - Setup step 6 "SimBrief" with a connection test, and a SimBrief tab in Settings (username, test, download limit per session). - Fetch and parse the latest OFP (origin, destination, alternate, navlog) once per streaming session, 10 s timeout, in the background. Any answer of an unexpected shape is "could not be read", a failing fetch is "no plan": logged, never a mount failure, and the stop logs a failure of the SimBrief work and still disposes everything. The username is never logged nor shown in the setup summary; User-Agent orthostreamxp/<version> for every server. - Departure prefetch: the 3 x 4 DSF tiles X-Plane loads around the departure, ordered by PrefetchPlanner.Select without motion, each texture to the level the paging model predicts from the gate, at Warm at most. A departure request never replaces a waiting load-ahead request, and load-ahead's replaces it (H1). Without mip streaming (or unreadable DSFs): the textures within simbrief-radius-km at full detail, bounded by the background queue, outside the budget (documented and logged). - A plan older than 6 h, or an aircraft already > 50 km away, skips the prefetch. - Download budget simbrief-download-limit (1000 MB): when spent, the waiting SimBrief requests are dropped; load-ahead and X-Plane's reads never count, nor do tiles the cache has. - Areas X-Plane never opened go first when the cache is trimmed; once flown they are trimmed by age like any other. - Per-phase summary at stop (queued, builds, tiles/MB, build time, hit rate). - Home: a session switch and the flight plan line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Once the aircraft has stood at the departure for 30 s, the 3 x 4 tiles around the arrival, then the climb to TOC (capped at 200 NM / 25 min), are queued at Background+1.. priorities, below everything else (R3). Load-ahead outranks the departure, the departure outranks the ground pre-warm (H1). - The gate and the takeoff roll come from X-Plane's own groundspeed and onground_any datarefs (R6): moving or lifting the camera in an outside view no longer counts (M4). Without them, the speed from the positions and the camera height as before. Home's speed and the flight-report samples use X-Plane's ground speed too. - On the takeoff roll (> 40 kt, or airborne) the requests still waiting are dropped, the ground ones and the departure's (H4). If the first real position is more than 50 km from the departure, the departure requests are dropped (R11). - The build memory is given back once the pre-warm is built and it is quiet: no build and no read from X-Plane for 10 s (a compacting GC pauses every thread, R1). The pause and the working set a minute later are logged. - Home: "Reload SimBrief flight plan", the only re-fetch, no polling (R9). A new plan drops the old one's waiting requests, builds its departure (also when the old plan was too old to have built it), restarts the download limit, and watches the new gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simbrief-alternate = on (Setup and Settings): the ground pre-warm builds the alternate's 3 x 4 tiles after the arrival, before the climb. Off by default: it is rarely flown and spends downloads from the same limit. An alternate that is the arrival or the departure is not built twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
058c7db to
07c9355
Compare
|
Hi, Quick update on the SimBrief prefetch feature: the implementation is complete, and the happy path works as I intended. Unfortunately, due to unforeseen personal time constraints, I won’t be able to run all the remaining edge-case tests before the end of the year. Rather than leaving the work sitting in my fork, I’ve opened this PR against develop so it’s available to you. The edge cases haven’t been fully tested yet, so please keep that in mind. It’s entirely up to you how to proceed. You could merge it into develop for further testing, keep it open until the edge cases are covered, or close it if it doesn’t fit your plans. I’m happy to answer questions about the implementation in the meantime, and I’ll come back to it when I have more time. Thanks for the project and for considering the contribution! |
|
@MarcelL94 Thanks for the update, and for putting this PR up so it isn't stuck in your fork. Glad to hear the main flow is working the way you planned. No rush on the edge cases. I'm happy to leave the PR open until you have time to come back to it. Take care of things on your side first, the project isn't going anywhere. |
What it does
An optional SimBrief prefetch. It stays off until a SimBrief username or Pilot ID is set (
simbrief-user). SimBrief failures are only logged; they never make the mount fail.Three commits, in the order you asked for:
Warmpriority at most (R2). Also in this commit: the download budgetsimbrief-max-mb(default 1000 MB, R4), cache trimming that removes areas X-Plane never opened first (R5), one User-Agentorthostreamxp/<version>for every server (R7), the username kept out of all logs (R8), a 10 s timeout with the fetch in the background (R10), skipping plans older than 6 h (R11), and a summary per phase when streaming stops (R12).Background+1..priorities, below everything else (R3). A waiting ground request gives way to load-ahead (H1). On the takeoff roll (> 40 kt), requests still waiting are dropped, both the ground ones and the departure's (H4). If the first real position is more than 50 km from the departure, the departure requests are dropped (R11). Build memory is given back once the pre-warm finishes. The Home button Reload SimBrief flight plan is the only re-fetch; there is no polling (R9).simbrief-alternate, off by default.How the work is split, so each commit makes sense on its own:
R6: reusing the existing models (your call before I rework anything)
PagingModel.MipForPagingModelSceneryArea.TilesAround(3 × 4 rule)SceneryLoadsonly observes DSF opensDsfTerrainnext toSceneryLoadsMipWarmer.PrefetchPlacedPrefetchPlanner(track-based)PrefetchPlanner.Selectcan take a point; otherwise keep it and say whyGroundWatchon the camera's motionAircraftPositionListenerhas no on-ground or ground-speed dataAircraftPositionListenerand letGroundWatchuse them. This also fixes the camera-speed issue in outside views (M4)Testing
dotnet build OrthoStreamXP.slnx: 0 warnings after each commit (TreatWarningsAsErrors,AnalysisMode=Recommended).dotnet test --solution OrthoStreamXP.slnxon Windows with WinFsp (MountSmokeTestsran): 406 / 430 / 432 passed, 0 failed, 0 skipped after commits 1 / 2 / 3.develop(65deb09).Numbers so far (earlier builds; to be redone)
EDDV, empty cache, Ultra, 128 download workers, X-Plane's first load at the gate:
EDDV → ENGM, 121 min, gate pre-warm on (alternate included in that build): 33,714 reads, 1 wait (4 ms), 3 flat far reads, 0 failed builds. At ENGM, 95–98 % of the textures X-Plane loaded already had what it wanted, against 1–6 % on rows that were not pre-warmed. There was no control flight, so the 0 waits at ENGM are not a measured difference yet. Working set went up to 4 GB during the pre-warm in that build. The memory give-back in commit 2 addresses that but has not been flown yet.
Still to do before ready for review: 3–5 flights of different lengths and regions with the per-phase summary (R12), then the table above, a decision on the 1000 MB default and on whether the alternate is worth keeping, and your answer on R6.
🤖 Generated with Claude Code