Skip to content

Path to adding a Tier 2 build with pointer compression enabled #3204

Closed

Description

@cjihrig

This is a follow up to nodejs/TSC#790. The project currently creates unofficial builds for Linux with pointer compression enabled. With pointer compression enabled, the main branch appears to pass the test suite (at least on macOS where I tested). From what I can tell, v19 and earlier are not in such good shape.

We are interested in getting pointer compression into the CI, and eventually hopefully get it to Tier 2 status (on Linux would be enough). cc: @nodejs/releasers.

I think the first step would be getting this into the CI so that we can have more confidence in the current unofficial build. Unfortunately, I don't have the slightest idea what needs to happen to add a new CI target - but I am willing to do the work if someone can provide guidance.

cc: @mhdawson @mcollina

Activity

  1. mhdawson commented on Feb 23, 2023

    @mhdawson
    Member

    I think two questions we should get feedback on to start are:

    1. @nodejs/tsc would it be ok to have pointer compression only enabled for Linux
    2. @nodejs/releasers any concern in respect to adding a compressed pointer release to the shipping binaries?
  2. RafaelGSS commented on Feb 23, 2023

    @RafaelGSS
    Member

    As a Node.js TSC and Releaser, I'm +1. I don't see it impacting the release workflow directly. However, might make sense to produce a release candidate for LTS versions first (optional)

  3. richardlau commented on Feb 23, 2023

    @richardlau
    Member
    1. @nodejs/releasers any concern in respect to adding a compressed pointer release to the shipping binaries?

    Yes, I have concerns about confusion to end users in producing a second Linux download, particularly as I seem to recall concerns about ABI compatibility between regular builds and pointer compression enabled ones (think about ecosystem packages using prebuilds, for example).

  4. cjihrig commented on Feb 23, 2023

    @cjihrig
    ContributorAuthor

    @richardlau would you feel better about only adding pointer compression to the CI so that we can at least have more confidence in the existing unofficial build?

  5. richardlau commented on Feb 23, 2023

    @richardlau
    Member

    @cjihrig my response was specifically to the quoted question. I'm neutral on adding another job to the CI.

  6. mhdawson commented on Mar 2, 2023

    @mhdawson
    Member

    Adding another job to the CI seems resonable to me as we already have machines of the required type available and my first guess is that we would not need additional machines to support the one extra job.

  7. cjihrig commented on Mar 3, 2023

    @cjihrig
    ContributorAuthor

    @mhdawson so what would be the next step to add the CI job? I'm happy to help, but don't know where/how to get started.

  8. mhdawson commented on Mar 15, 2023

    @mhdawson
    Member

    I don't see any objections to adding a CI job, so I'll set up a job Colin can edit/work on and then we can take it from there. It probably will mostly be a clone of some other job.

  9. mhdawson commented on Mar 16, 2023

    @mhdawson
    Member

    Added this job with @cjihrig - https://ci.nodejs.org/job/node-test-commit-linux-pointer-compression.

    Just letting it run to confirm it passes and then will add to the daily main run.

  10. mhdawson commented on Mar 16, 2023

    @mhdawson
    Member

    To answer a question people might ask we did not add as a containerized build as I was not sure how to do that and only have it run in the nightly.

  11. mhdawson commented on Mar 16, 2023

    @mhdawson
    Member

    Configured the job so that @cjihrig can edit/modify the job in cases changes/fixes are needed.

  12. mhdawson commented on Mar 17, 2023

    @mhdawson
    Member

    Had to fixup the addition to the daily main job as it did not run today. Believe it should run next time.

  13. cjihrig commented on Mar 31, 2023

    @cjihrig
    ContributorAuthor

    @mhdawson thanks for the help getting the pointer compression job into the daily job. It looks like it has passed every time it has run for the past few weeks with the exception of one time when GitHub changed the key.

    As a next step, does it make sense to add pointer compression to the CI for pull requests on main (from my testing, v19 and older do not work properly with pointer compression)?

  14. mhdawson commented on Apr 4, 2023

    @mhdawson
    Member

    The part about only running on v19 and later is one that may require something special. @richardlau I don't think the VersionSelectorSecript can help us on this one right?

  15. richardlau commented on Apr 5, 2023

    @richardlau
    Member

    That is exactly what the VersionSelectorScript is intended for. However it works on labels (specifically on a build parameter named "nodes"), so you may need to rework the job and/or introduce new labels.

  16. 20 remaining items

  17. mikeduminy commented on Apr 22, 2024

    @mikeduminy

    I'd love to be able to use an official build that enables pointer compression on mac. Would that need a separate build?

  18. mcollina commented on Apr 22, 2024

    @mcollina
    SponsorMember

    yes

  19. ronag commented on Aug 5, 2024

    @ronag
    Member

    Did we give up on pointer compression? I've been unable to try it out. Haven't been able to find a recent build nor have been able to figure out how to create a build myself. Hard to give feedback (for anyone) with the current state of things.

  20. richardlau commented on Aug 5, 2024

    @richardlau
    Member

    Did we give up on pointer compression? I've been unable to try it out. Haven't been able to find a recent build nor have been able to figure out how to create a build myself. Hard to give feedback (for anyone) with the current state of things.

    Nobody appears to be paying any attention to it.

  21. jasnell commented on Aug 5, 2024

    @jasnell
    Member

    No, we haven't given up and definitely still are paying attention. Cloudflare has engaged a contract with Igalia to look at a path that hopeful would enable, in part, Node.js to enable pointer compression by default in the future.

    Specifically, one of the limiting factors with enabling pointer compression to this point has been the strict limit of a single 4gb pointer cage per-process. Limiting the entire process to a single 4gb limit would be too much of a breaking change.

    To support the alternative configuration we have in Cloudflare Workers, for a different use case that touches on the same parts of v8, Igalia is working on a way to enable multiple pointer cages per process. We call the new API an IsolateGroup. Each IsolateGroup represents one cage, with N Isolates allowed per IsolateCage. A process would allow any number of IsolateGroups to be created. Each IsolateGroup still has the 4gb limit but the ability to create multiple cages per process is a lot more tractable than a single 4gb cage for the entire process.

    While it would still definitely be a semver-major and potentially breaking change, I think this approach would make it far more likely that we can enable pointer compression by default in Node.js or at least provide a release distribution with pointer compression enabled.

  22. ronag commented on Aug 5, 2024

    @ronag
    Member

    Specifically, one of the limiting factors with enabling pointer compression to this point has been the strict limit of a single 4gb pointer cage per-process.

    FWIW this is not a problem for us. I don't think it's a problem for a majority of users. IMHO two separate builds would be fine. Advanced users can use the pointer compression build.

  23. mcollina commented on Aug 6, 2024

    @mcollina
    SponsorMember

    In the past, I thought we (Platformatic) could sponsor some of this infra work, but startup life got in the way, and this is not a priority anymore. We would definitely use a Node.js build with pointer compression enabled, but the main driver for investing to make it happen is gone.

  24. jasnell commented on Aug 7, 2024

    @jasnell
    Member

    My hope is that the new IsolateGroups will at least make it less of a potentially breaking change. We have users, however, that depend on extremely large heap sizes that, even with compression, go well beyond the 4gb limit so we have to be careful. Having the IsolateGroup API there should also make it easier for us to transition to this mode in general.

  25. SeanReece commented on Aug 8, 2024

    @SeanReece

    FWIW this is not a problem for us. I don't think it's a problem for a majority of users.

    At the risk of beating a dead horse here I have to agree. The max-old-space-size defaults to 2GB on 64bit systems and I’m willing to bet most node developers have not had a use case to increase this. Even having pointer compression be the default would increase the default heap limit 2x and advanced developers could just switch to the non-compressed build for use cases requiring more heap space.

    What @jasnell is working on sounds very interesting and promising. But I hope we can get the pointer compression build back on track regardless.

  26. jdmarshall commented on Sep 5, 2024

    @jdmarshall

    @jasnell What do you mean by well beyond 4GB? If you have lots of object graphs it's entirely possible for 6GB heap to comfortably fit into 4GB with compression enabled.

    Also I haven't heard anybody petitioning for eliminating 64 bit pointers. The argument is which is the default case and which is the special case. Right now it's very much backward from reality.

  27. jdmarshall commented on Sep 5, 2024

    @jdmarshall

    FWIW this is not a problem for us. I don't think it's a problem for a majority of users. IMHO two separate builds would be fine. Advanced users can use the pointer compression build.

    @ronag I would take the opposite conclusion from this. If 4GB cage isn't a problem for most users, then the advanced users should be the ones looking at the uncompressed build, not the other way around.

  28. jasnell commented on Sep 5, 2024

    @jasnell
    Member

    I've talked with folks that run in excess of 20gb heaps in certain extreme cases. I think Netflix has also seen this but I'd need to confirm again. I do think the excessively sized heaps are not the norm and experience has shown that the vast majority of cases can fit well within a 4gb compressed heap.

  29. jdmarshall commented on Sep 25, 2024

    @jdmarshall

    @cjihrig completed?

  30. cjihrig commented on Sep 25, 2024

    @cjihrig
    ContributorAuthor

    No. Clearing my issues list. If anyone needs this issue, please open a new one.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions