Skip to content

Color pipeline preparations#1090

Merged
mahkoh merged 4 commits into
masterfrom
jorth/random-cache
Jul 14, 2026
Merged

Color pipeline preparations#1090
mahkoh merged 4 commits into
masterfrom
jorth/random-cache

Conversation

@mahkoh

@mahkoh mahkoh commented Jul 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 14, 2026 14:46
github-actions[bot]
github-actions Bot previously approved these changes Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR lays groundwork for upcoming color/pipeline work by standardizing hash collections on hashbrown + ahash::RandomState and introducing explicit “safe-to-clone/hash for interior-mutable caches” marker traits/macros, while updating many call sites and a few key types used in rendering/color-management paths.

Changes:

  • Replace widespread ahash::{AHashMap, AHashSet} usage with utils::bhash::{BHashMap, BHashSet} (hashbrown-backed).
  • Introduce unsafe marker traits JayClone / JayHash plus proc-macros #[jay_clone] / #[jay_hash] and migrate types/bounds away from UnsafeCellCloneSafe.
  • Add utils::random_cache with unit tests and integrate new HashMap/HashSet extension traits.

Reviewed changes

Copilot reviewed 122 out of 123 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/xwayland/xwm.rs Swap window/seats caches to BHashMap/BHashSet.
src/xcon.rs Use BHashMap for extension lookup tables.
src/wl_usr/usr_ifs/usr_wl_data_offer.rs Track MIME types with BHashSet.
src/wl_usr/usr_ifs/usr_jay_render_ctx.rs Switch render ctx format maps to BHashMap.
src/vulkan_core.rs Migrate Vulkan layer/extension collections to BHashMap/BHashSet; align ext traits.
src/virtual_output.rs Use BHashMap for transaction changes.
src/video/drm/syncobj.rs Introduce #[jay_hash] / #[jay_clone] usage for IDs/handles; remove old marker.
src/video/drm.rs Convert DRM caches to BHashMap; add #[jay_hash] for DRM object IDs.
src/utils/stack.rs Replace UnsafeCellCloneSafe bound with JayClone.
src/utils/smallmap.rs Replace UnsafeCellCloneSafe bound with JayClone.
src/utils/reset.rs Reset impl updated from AHashMap to BHashMap.
src/utils/random_cache/tests.rs New tests for RandomCache.
src/utils/random_cache.rs New randomized cache implementation using hashbrown::HashTable.
src/utils/ordered_float.rs Mark ordered float wrapper as JayHash.
src/utils/opaque.rs Use proc-macros for clone/hash marker support.
src/utils/obj_and_id.rs Replace UnsafeCellCloneSafe bound with JayClone.
src/utils/markers.rs New marker traits JayClone / JayHash and core impl set.
src/utils/linkedlist.rs Mark NodeRef as JayClone.
src/utils/hash_map_ext.rs Rework extensions around hashbrown::{HashMap, HashSet} and Equivalent.
src/utils/copyhashmap.rs Convert internal map to BHashMap; tighten bounds to JayClone/JayHash.
src/utils/clonecell.rs Replace UnsafeCellCloneSafe with JayClone; remove old trait.
src/utils/bindings.rs Convert nested binding maps to BHashMap; use hashbrown Entry.
src/utils/bhash.rs New BHashMap/BHashSet type aliases.
src/utils.rs Export new bhash, markers, and random_cache modules.
src/tree/output.rs Use BHashMap for watcher kill list; add #[jay_hash] on PointerType.
src/tree/float.rs Convert cursor map cache to BHashMap.
src/tree/container.rs Convert child/cursor maps to BHashMap.
src/tracy/tracy_impl.rs Convert tracy name caches to BHashMap.
src/tools/tool_client.rs Convert handler/pending maps to BHashMap.
src/theme.rs Add #[jay_clone(Copy)] for Color.
src/tagged_acceptor.rs Convert acceptor registry to BHashMap.
src/syncobj/wait_for_syncobj.rs Add #[jay_hash] on job id newtype.
src/state.rs Convert state maps/sets to BHashMap/BHashSet; remove IsntHashMapExt import.
src/sm/sm_jobs/sm_session_list.rs Convert session map to BHashMap.
src/scale.rs Add #[jay_hash] for Scale.
src/portal/ptl_screencast.rs Replace set types; use #[jay_clone] for phases/targets.
src/portal/ptl_render_ctx.rs Convert format maps to BHashMap.
src/portal/ptl_remote_desktop.rs Use #[jay_clone] for phase enum; remove old marker.
src/portal/ptl_gui.rs Convert hover set to BHashSet.
src/portal/ptl_display.rs Convert global registry map and format maps to BHashMap.
src/pipewire/pw_pod.rs Add #[jay_hash] in ty! newtype macro.
src/pipewire/pw_parser.rs Return BHashMap for parsed dict structs.
src/object.rs Add #[jay_hash] to ObjectId.
src/macros.rs Add #[jay_hash] / #[jay_clone] to various ID/newtype macros.
src/leaks.rs Convert leak tracking maps/sets to BHashMap/BHashSet.
src/kbvm.rs Add #[jay_hash] to KbvmMapId.
src/it/tests/t0024_foreign_toplevel_list.rs Switch ID set to BHashSet.
src/it/tests/t0022_toplevel_suspended.rs Switch to local HashSetExt helper.
src/it/test_ifs/test_xdg_toplevel.rs Switch states set to BHashSet.
src/it/test_ifs/test_data_control_offer.rs Switch offers set to BHashSet.
src/it/test_gfx_api.rs Convert format map to BHashMap.
src/it/test_backend.rs Convert connectors map to BHashMap.
src/it.rs Convert failure aggregation map to BHashMap; remove IsntHashMapExt.
src/ifs/zwp_linux_buffer_params_v1.rs Convert planes map to BHashMap.
src/ifs/wp_presentation_feedback.rs Change outputs argument map type to BHashMap.
src/ifs/wl_surface/xdg_surface/xdg_toplevel/xdg_toplevel_icon_v1.rs Convert internal maps/sets; add #[jay_clone] / #[jay_hash] for keys/enums.
src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs Convert children map to BHashMap; import cleanup.
src/ifs/wl_surface/wl_subsurface.rs Use hashbrown entry types with explicit hasher parameter.
src/ifs/wl_surface.rs Convert subsurface/parent maps to BHashMap; use hashbrown entry types.
src/ifs/wl_seat/text_input/zwp_text_input_v3.rs Use hashbrown Entry import.
src/ifs/wl_seat/event_handling.rs Use hashbrown Entry import.
src/ifs/wl_seat.rs Convert nested binding/device maps to BHashMap; use hashbrown Entry.
src/ifs/wl_output.rs Convert bindings map to BHashMap; mark OutputId as JayHash.
src/ifs/jay_screencast.rs Convert workspace sets to BHashSet; use #[jay_clone] for enums.
src/ifs/ipc.rs Convert MIME type set to BHashSet.
src/ifs/head_management.rs Use hashbrown Entry import.
src/icons.rs Convert icon size set to BHashSet.
src/globals.rs Add #[jay_hash] to GlobalName.
src/gfx_apis/vulkan/renderer.rs Convert caches/maps to BHashMap; add #[jay_hash] to pipeline key enums/newtypes.
src/gfx_apis/vulkan/format.rs Convert modifier maps to BHashMap; remove IsntHashMapExt usage.
src/gfx_apis/vulkan/eotfs.rs Add #[jay_hash] to VulkanEotf.
src/gfx_apis/vulkan/device.rs Convert format map to BHashMap; remove IsntHashMapExt usage.
src/gfx_apis/vulkan/blend_buffer.rs Use hashbrown Entry API; adjust insertion call.
src/gfx_apis/vulkan.rs Update GfxContext::formats map type to BHashMap.
src/gfx_apis/gl/renderer/context.rs Update GL context formats map type to BHashMap.
src/gfx_apis/gl/ext.rs Convert extension set to BHashSet.
src/gfx_apis/gl/egl/display.rs Convert EGL format map to BHashMap.
src/gfx_apis/gl/egl/context.rs Convert EGL context formats map to BHashMap.
src/gfx_api.rs Update public GfxContext::formats signature and cross_intersect_formats to BHashMap; use #[jay_clone] / #[jay_hash].
src/format.rs Convert global format lookup tables to BHashMap.
src/forker.rs Convert fd-mapping helper maps to BHashMap.
src/ei/ei_object.rs Add #[jay_hash] to EiObjectId.
src/ei/ei_ifs/ei_touchscreen.rs Use hashbrown Entry; use #[jay_clone] for enum.
src/ei/ei_client.rs Convert client maps to BHashMap.
src/egui_adapter/egui_vulkan.rs Convert renderer caches to BHashMap; remove IsntHashMapExt.
src/edid.rs Use #[jay_clone] for parse context enum; remove old marker.
src/dmabuf_feedback.rs Convert sets to BHashSet; use local HashMapExt/HashSetExt.
src/dbus/socket.rs Use hashbrown Entry import.
src/dbus.rs Convert signal handler maps to BHashMap; add #[jay_hash] keys.
src/cursor.rs Convert cursor caches/sets to BHashMap/BHashSet.
src/criteria/crit_per_target_data.rs Convert per-target data map to BHashMap.
src/copy_device.rs Convert support maps/sets to BHashMap/BHashSet; remove IsntHashMapExt.
src/control_center/cc_window.rs Convert listener cache map to BHashMap.
src/control_center/cc_outputs.rs Convert outputs pane head map to BHashMap.
src/control_center/cc_input.rs Convert keymap map to BHashMap.
src/control_center/cc_criterion.rs Convert removal set to BHashSet; use local HashSetExt.
src/control_center/cc_clients.rs Convert matcher cache map to BHashMap.
src/config/handler.rs Change criterion cache bounds to JayHash; drop direct Hash import.
src/compositor.rs Convert tried-backends set to BHashSet.
src/cmm/cmm_primaries.rs Add #[jay_hash] for primaries types used in color management.
src/cmm/cmm_manager.rs Add #[jay_hash] for description keys in color manager.
src/cmm/cmm_luminance.rs Add #[jay_hash] for luminance structs.
src/cmm/cmm_eotf.rs Add #[jay_hash] for EOTF types.
src/client.rs Convert client registries to BHashMap; add #[jay_hash] for ClientId.
src/cli/tree.rs Convert CLI query maps/sets to BHashMap/BHashSet.
src/cli/seat_test.rs Convert seat name map to BHashMap.
src/cli/input.rs Convert seat aggregation map to BHashMap.
src/cli/clients.rs Convert client query return type to BHashMap.
src/bugs.rs Convert static bug maps to BHashMap.
src/buffer_id_device.rs Remove IsntHashMapExt usage; align with HashMapExt.
src/backends/x.rs Convert connector map to BHashMap.
src/backends/metal/video.rs Convert DRM metadata maps/sets to BHashMap/BHashSet; remove IsntHashMapExt.
src/backends/metal/transaction.rs Remove IsntHashMapExt usage; align with HashMapExt.
src/backends/metal/allocator.rs Switch modifier intersection set type to BHashSet.
src/backends/metal.rs Use #[jay_clone] for device enum; remove old marker.
src/backend/transaction.rs Convert transaction maps to BHashMap; use hashbrown Entry.
src/backend.rs Add #[jay_hash] to backend Mode and capability enums.
jay-proc/src/markers/hash.rs New proc-macro implementation for #[jay_hash].
jay-proc/src/markers/clone.rs New proc-macro implementation for #[jay_clone].
jay-proc/src/markers.rs New shared parsing support for marker proc-macros.
jay-proc/src/lib.rs Export jay_clone / jay_hash attribute macros.
Cargo.toml Add hashbrown dependency.
Cargo.lock Lock hashbrown dependency version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/random_cache.rs
Comment thread src/utils/random_cache/tests.rs
@mahkoh mahkoh merged commit 12733da into master Jul 14, 2026
12 checks passed
@mahkoh mahkoh deleted the jorth/random-cache branch July 14, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants