Skip to content

Conversation

@fingolfin
Copy link
Member

@fingolfin fingolfin commented Jun 27, 2025

This PR replaces the IMMUTABLE but in some of our tnums by an object flag. Doing this has been my plan since at least 2018 and I've started and abandoned attempts at this several times.

Originally a motivation was to support HPC-GAP but this has faded away. But this PR also makes it easier to ensure immutability is never removed accidentally. It also removes a lot of code, and simplifies some stuff.

This PR is kinda big. It contains PRs #6021, #6023, #6024 (or at least versions of them), I split those out because I could and anything to make this PR smaller is helpful.

I'll give a rough guide of the PRs, which are meant to be reviewed individually -- once it makes sense to review this, as right now I am sure some stuff will not yet be fully working.

  • These are also in other PRs
    • kernel: use IS_PREC in PRINT_PATH
    • kernel: use IS_MUTABLE_OBJ in UNB_LIST/ASS_LIST/ASSS_LIST
    • kernel: move & reuse plist type helpers
    • kernel: tighten famfirst computation in KTNumPlist
    • kernel: let KTNumPlist & KTNumHomPlist return mutable tnum
    • kernel: rewrite OneMatrix/InvMatrix to not use IMMUTABLE
  • Various smaller refactorings that could also go into master but they seem a bit artificial on their own
    • kernel: use MUTABLE_TNUM to avoid some uses of IMMUTABLE
    • kernel: replace IS_PLIST_MUTABLE by IS_MUTABLE_OBJ
    • Remove IMMUTABLE: src/plist.h
    • kernel: make implicit mutability check explicit
  • Add the new object flag meant for storing (im)mutability info in the future
    • kernel: add OBJ_FLAG_IMMUTABLE
  • Remove some soon superfluous code referencing IMMUTABLE
    • kernel: remove MakeBagTypePublic calls for IMMUTABLE tnums
    • kernel: remove IMMUTABLE from FiltListTNums handling
    • kernel: adjust IS_* helpers to ignore IMMUTABLE
  • Mass removal of repetitive code referring to IMMUTABLE which now is just superfluous
    • Remove IMMUTABLE: src/blister.c
    • Remove IMMUTABLE: src/listoper.c
    • Remove IMMUTABLE: src/lists.c
    • Remove IMMUTABLE: src/objset.c
    • Remove IMMUTABLE: src/plist.c
    • Remove IMMUTABLE: src/precord.c
    • Remove IMMUTABLE: src/range.c
    • Remove IMMUTABLE: src/stringobj.c
    • Remove IMMUTABLE: src/vecffe.c
    • Remove IMMUTABLE: src/vector.c
    • Remove IMMUTABLE: src/hpc/serialize.c
  • Removing the last traces and switching to OBJ_FLAG_IMMUTABLE
    • Remove (IM)MUTABLE_TNUM
    • kernel: remove IMMUTABLE
    • Fix lib/mat8bit.gi to deal with IMMUTABLE removal
    • WIP: fixup TypePlistHomHelper

@fingolfin fingolfin added topic: kernel release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant