Skip to content

Bug: models with a partition stream over 256 MiB open empty, with no error #1075

Open

Description

@hemanth1986

Description

Large real-world models open with zero elements and zero levels and no error. They keep almost all of their content in a single partition stream that exceeds the default 256 MiB stream limit (DEFAULT_MAX_STREAM_BYTES, reader.rs). The read failure is swallowed, so rvt-ifc writes an empty model; the diagnostics only show walker-max-record-decode-bytes: walker candidate decode stopped.

rvt-rs version

0.6.1 (also checked 0.10.0: same files empty)

Revit release the input file came from

2024

Input file size (bytes)

Two files: about 438 MB and 1.13 GB on disk. The biggest stream in each: Partitions/189 at 402.7 MiB and Partitions/0 at 1056.8 MiB, before inflation. A 202 MB model whose biggest stream is 141 MiB reads fine.

Command or API call

rvt-ifc model.rvt -o model.ifc --diagnostics model.json

Actual output

rvt-ifc: 0 building element(s) ... on 0 storey(s)

Expected output

The model's elements. With three limits raised (DEFAULT_MAX_STREAM_BYTES to 2 GiB, DEFAULT_MAX_INFLATE_BYTES to 6 GiB, walker max_scan_bytes to 6 GiB) the two files read as 9,917 elements on 35 storeys and 21,021 elements on 14 storeys, at 3.7 GB and 5.1 GB peak memory.

Suggestions: report a stream over the limit as a clear error or a diagnostics entry instead of an empty model, and consider higher defaults or one documented knob for all three limits. The files are client work and can't be shared; happy to test a build.

Activity

  1. DrunkOnJava commented on Oct 29, 2026

    @DrunkOnJava
    Owner

    Thank you for the measurements, they were enough to find it without the files.

    What happened. At 0.10.0 almost every partition reader skips a partition it cannot read and goes on (about 87 of the 93 call sites drop the error), so a Partitions/NN over the 256 MiB stream limit was skipped by all of them, with no diagnostic and exit status 0. One more thing your raised-limit run may have hit: the inflated total of one partition was capped at a literal 1 GiB that no limit raised, and a partition past it was cut at a member boundary, silently. If Partitions/0 (1,056.8 MiB stored) inflates past 1 GiB, your 21,021 elements may be a truncated read.

    What changed (#1083, merged as c2bb334).

    • Every stream a limit stops is recorded and listed in the diagnostics (stream_not_read_resource_limit, one Not read whole: warning per stream with its stored size, the limit and which one).
    • rvt-ifc and rvt-gltf write no model and exit with status 3 unless --allow-partial.
    • --large-model raises the limits (streams up to 2 GiB, 8 GiB inflated, walker scan 8 GiB); --max-stream-bytes and --max-inflate-bytes set them yourself. A stream's inflated total is now max_inflate_bytes or 1 GiB, whichever is larger, so raising one raises the other.
    • Python: write_ifc() raises ValueError while a stream is unread unless allow_partial=True, and RevitFile.unread_streams() lists them.

    If you can check it on your two files (no file needs to leave your machine):

    cargo install --git https://github.com/DrunkOnJava/rvt-rs --rev c2bb3341 rvt --bin rvt-ifc --locked
    rvt-ifc model.rvt -o /dev/null                       # expect exit 3 and the stream lines
    /usr/bin/time -v rvt-ifc model.rvt -o model.ifc --large-model --diagnostics d.json --anonymize

    (/usr/bin/time -l on macOS.) The numbers that would settle it: the exit status and stderr lines of the first run, and for the second the element counts by IFC class and the storey count from the summary line, whether d.json still lists any stream_not_read_resource_limit item, the peak resident memory and the wall time, and whether the counts differ from your 9,917 / 35 and 21,021 / 14. --anonymize keeps counts and ElementIds and drops names; the counts alone are enough. The 202 MB model that reads today, as a control, should come out unchanged.

    I'll keep this open until we hear how your files do. Your #421 report is a separate fix (#1081); more there.

  2. DrunkOnJava commented on Oct 30, 2026

    @DrunkOnJava
    Owner

    @hemanth1986, the fix for models whose partition streams are over the reader's limits shipped in v0.11.0. We measured it only by lowering the limits below our reference files' streams. No model over the default limits has been read with --large-model yet, so your models are the real test.

    If you can run it on the ones that came out empty:

    rvt-ifc model.rvt -o model.ifc --diagnostics d.json; echo "exit $?"
    rvt-ifc model.rvt -o model.ifc --diagnostics d-large.json --large-model; echo "exit $?"

    The first should exit with status 3, write no IFC and name each stream it could not read. The second should read them and export the model. Counts only would tell us whether it works:

    • the exit status of each run;
    • the streams the first run names, with their sizes;
    • the elements and storeys the second exports;
    • its peak memory and time if you can see them (/usr/bin/time -v on Linux, Task Manager on Windows).

    In the viewer, the File status panel offers 'Retry with large-model limits'. A browser tab is capped at 4 GiB, so a very large model may still fail there, and the CLI is the better test.

  3. added
    area:reader
    priority:P1
    type:bug
    community
    on Oct 30, 2026
  4. 30 remaining items

  5. DrunkOnJava commented on Nov 4, 2026

    @DrunkOnJava
    Owner

    0.14.0 is released with the memory work from this thread (#1329). The cache of inflated partitions no longer holds each partition twice, the native passes strip their pages in place instead of copying them, and the saved graphics of doors and windows are decoded in batches. On the BIM4LCA office as built, the peak resident memory of a whole rvt-ifc run went from 1,690 MiB with 0.13.0 to 913 MiB, and #1329 left every export byte for byte as it was. Your 438 MB model is what this was for, and we can't measure it here: could you run the same probe at the tag and paste its table (memory and counts only)?

    git checkout v0.14.0
    cargo run --profile ci -p rvt-probes --example probe_1075_memory_stages -- <the 438 MB file> --large-model
    
  6. DrunkOnJava commented on Nov 9, 2026

    @DrunkOnJava
    Owner

    @hemanth1986, a change that may touch your 438 MB model's memory is on a branch, and I would like your numbers before it is released.

    The change. #1610 (for #1191) draws every family instance that would be a bounding box from the mesh Revit saved for it, by default, on Revit 2023 to 2027 files. Only doors and windows were until now. On the BIM4LCA office as built, the largest model we can measure, it takes the peak from 913 to 1,423 MiB (+56%) and the time from 21.2 to 24.4 s; where a file has few boxed families it costs nothing (Core Interior's peak is 305 MiB either way). What it adds depends on how many boxed elements a file holds, which your counts do not say, so on your model it may be much less, or more.

    What would tell us, memory and counts only, as before:

    git fetch origin feat/1191-saved-meshes-default && git checkout 3f03993c
    cargo run --profile ci -p rvt-probes --example probe_1075_memory_stages -- <the 438 MB file> --large-model

    The probe takes the default scope, so its saved meshes row now draws every boxed element: that row's replaced count (279 of 432 in your table of 2026-11-04) and its peak are the numbers, against the 11.41 GiB of that table.

    rvt-ifc --no-saved-meshes (Python saved_meshes=False) returns the previous memory, and the release notes will name it. If the new default takes your file past the machine's memory, tell us which stage and by how much, and we will look at it before the release.

  7. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    Owner

    @hemanth1986, 0.18.0 is tagged with the change I asked for your numbers on (#1610, for #1191: every boxed element of a Revit 2023 to 2027 file drawn from the mesh Revit saved for it, by default). I did not hear back before cutting it, and the cost measured on the final code is larger than my comment of 2026-11-09 said, so here are the corrected figures and the same request.

    What I wrote then, corrected (Measure run 42956917709, 0.17.0 against the released source, one runner per file, the median of three exports):

    file 0.17.0 0.18.0
    BIM4LCA office, concrete, as built 25.4 s, 914 MiB 33.0 s, 1,432 MiB
    Core Interior (2024) 4.7 s, 305 MiB 5.3 s, 437 MiB
    Snowdon Towers Architectural (2024) 17.6 s, 1,073 MiB 28.0 s, 2,086 MiB
    rac_basic 2023 1.9 s, 200 MiB 3.4 s, 875 MiB

    I said the office goes 21.2 to 24.4 s and that Core Interior's peak is 305 MiB "either way": both are larger now, because the pass also reads every wall since RE-388. #1691 (in 0.18.0) brought the large files down (Core Interior 647 to 437 MiB, Snowdon Architectural 3,964 to 2,086 MiB). Across Autodesk's 28 samples of Revit 2023 to 2027 the cost is 1.1 to 1.9 times the time and 1.4 to 4.4 times the peak memory. Files of Revit 2015 to 2022 are within 2% of 0.17.0's time and memory. Where the rest sits is being profiled on #1694: on the samples I can measure it is a transient inside the pass, not the cache of inflated partitions (the 3.38 GB your table of 2026-11-04 showed for your file is that cache), and it is the next thing I fix.

    rvt-ifc --no-saved-meshes (Python saved_meshes=False) returns 0.17.0's memory, and the release notes say so.

    What would tell us, memory and counts only, as before, on your 438 MB file (and the 1.13 GB one if the machine can take it):

    git fetch origin tag v0.18.0 && git checkout v0.18.0
    cargo run --profile ci -p rvt-probes --example probe_1075_memory_stages -- <the 438 MB file> --large-model

    Compare its saved meshes row (the replaced count and the peak) with the 11.41 GiB of your table of 2026-11-04. If the new default takes your file past the machine's memory, tell me which stage and by how much: that decides what #1694 fixes first.

  8. hemanth1986 commented on Nov 11, 2026

    @hemanth1986
    Author

    Hi I am sorry I am held with other things, I will try to get over some information in the next few days

  9. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    Owner

    No rush, @hemanth1986, and thank you for letting me know. The command and the figures to compare against are in my comment above; when you run it, counts and the saved meshes row are all I need. In the meantime rvt-ifc --no-saved-meshes returns 0.17.0's memory if 0.18.0 does not fit on your machine.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:readercommunitypriority:P1type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions