8000 Remove MATTER_ATTRIBUTE_FLAG_SINGLETON by andy31415 · Pull Request #39968 · project-chip/connectedhomeip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove MATTER_ATTRIBUTE_FLAG_SINGLETON #39968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 12, 2025

Conversation

andy31415
Copy link
Contributor
@andy31415 andy31415 commented Jul 11, 2025

Summary

Followup on https://github.com/project-chip/connectedhomeip/pull/39693/files#r2170150515

This flag is never used (grepped for it both here and in zap), so removed it. Maybe we gain a minute flash saving here.
Update:

  • it was used by BasicInformation cluster
  • there is no reason for this cluster to acutally be marked as a singleton though: it should exist on endpoint 0 only anyway.
  • had to clean up a LOT of zap files as a sideffect

Testing

This is a delete only. Expecting unit tests to still pass.

Copy link
Contributor
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the unused MATTER_ATTRIBUTE_FLAG_SINGLETON and its associated code. There is a syntax error on line 679 of src/app/util/attribute-storage.cpp that will prevent compilation.

@andy31415 andy31415 requested a review from Copilot July 11, 2025 14:49
@andy31415
Copy link
Contributor Author

/gemini review

Copy link
Contributor
@Copilot Copilot AI left a comment

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 removes the unused MATTER_ATTRIBUTE_FLAG_SINGLETON and all associated singleton-handling code and comments to simplify attribute storage and metadata.

  • Deleted the singleton attribute flag definition and IsSingleton() accessor in metadata.
  • Removed the singletonAttributeLocation helper and singleton branch from the read/write logic.
  • Cleaned up codegen comments to drop references to singleton attributes.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/data-model-providers/codegen/CodegenDataModelProvider.cpp Removed the bullet about IsSingleton in the NOTE comment block.
src/app/util/attribute-storage.cpp Deleted singletonAttributeLocation and removed singleton branch.
src/app/util/attribute-metadata.h Removed MATTER_ATTRIBUTE_FLAG_SINGLETON definition and method.
Comments suppressed due to low confidence (2)

src/data-model-providers/codegen/CodegenDataModelProvider.cpp:114

  • [nitpick] Align the indentation of the bullet comment with the "NOTE" comment above for consistent formatting. For example, use the same number of leading spaces on each line.
    //    - IsExternal/IsAutomaticallyPersisted is not used by IM handling

Copy link
Contributor
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the unused MATTER_ATTRIBUTE_FLAG_SINGLETON flag and its associated code. The changes are mostly correct, but I've pointed out a couple of issues. One is a critical issue where a usage of the removed flag was missed, which will cause a build failure. The other is a medium-severity suggestion to improve code clarity by completely removing a line related to the deleted flag instead of commenting it out.

@andy31415 andy31415 requested review from a team as code owners July 11, 2025 15:05
@github-actions github-actions bot added examples scripts examples chef Changes in examples/chef labels Jul 11, 2025
Copy link
github-actions bot commented Jul 11, 2025

PR #39968: Size comparison from 6d5aa8c to a135bf1

Full report (5 builds for cc32xx, stm32, tizen)
platform target config section 6d5aa8c a135bf1 change % change
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 548850 548802 -48 -0.0
RAM 205144 205104 -40 -0.0
lock CC3235SF_LAUNCHXL FLASH 581842 581794 -48 -0.0
RAM 205344 205304 -40 -0.0
stm32 light STM32WB5MM-DK FLASH 465292 465236 -56 -0.0
RAM 141376 141336 -40 -0.0
tizen all-clusters-app arm unknown 5096 5096 0 0.0
FLASH 1695816 1695632 -184 -0.0
RAM 91444 91404 -40 -0.0
chip-tool-ubsan arm unknown 20764 20764 0 0.0
FLASH 21066690 21066450 -240 -0.0
RAM 9165440 9165368 -72 -0.0

Copy link
github-actions bot commented Jul 11, 2025

PR #39968: Size comparison from 6d5aa8c to c15f0e0

Full report (11 builds for cc13x4_26x4, cc32xx, qpg, stm32, tizen)
platform target config section 6d5aa8c c15f0e0 change % change
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 763128 763080 -48 -0.0
RAM 103368 103328 -40 -0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 774668 774620 -48 -0.0
RAM 108536 108496 -40 -0.0
pump-app LP_EM_CC1354P10_6 FLASH 721008 720960 -48 -0.0
RAM 96940 96900 -40 -0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 705300 705252 -48 -0.0
RAM 97148 97108 -40 -0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 548850 548802 -48 -0.0
RAM 205144 205104 -40 -0.0
lock CC3235SF_LAUNCHXL FLASH 581842 581794 -48 -0.0
RAM 205344 205304 -40 -0.0
qpg lighting-app qpg6200+debug FLASH 744232 744184 -48 -0.0
RAM 94292 94252 -40 -0.0
lock-app qpg6200+debug FLASH 753852 753804 -48 -0.0
RAM 94320 94280 -40 -0.0
stm32 light STM32WB5MM-DK FLASH 465292 465236 -56 -0.0
RAM 141376 141336 -40 -0.0
tizen all-clusters-app arm unknown 5096 5096 0 0.0
FLASH 1695816 1695632 -184 -0.0
RAM 91444 91404 -40 -0.0
chip-tool-ubsan arm unknown 20764 20764 0 0.0
FLASH 21066690 21066450 -240 -0.0
RAM 9165440 9165368 -72 -0.0

Copy link
github-actions bot commented Jul 11, 2025

PR #39968: Size comparison from 6d5aa8c to bb7cc6d

Full report (57 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, psoc6, qpg, stm32, telink, tizen)
platform target config section 6d5aa8c bb7cc6d change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1102622 1102622 0 0.0
RAM 179010 178970 -40 -0.0
bl702 lighting-app bl702+eth FLASH 656030 656030 0 0.0
RAM 134961 134929 -32 -0.0
bl702+wifi FLASH 833212 833212 0 0.0
RAM 124517 124469 -48 -0.0
bl706+mfd+rpc+littlefs FLASH 1065330 1065330 0 0.0
RAM 117373 117341 -32 -0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 894876 894876 0 0.0
RAM 105660 105628 -32 -0.0
lighting-app bl702l+mfd+littlefs FLASH 978594 978594 0 0.0
RAM 109852 109820 -32 -0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 763128 763080 -48 -0.0
RAM 103368 103328 -40 -0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 774668 774620 -48 -0.0
RAM 108536 108496 -40 -0.0
pump-app LP_EM_CC1354P10_6 FLASH 721008 720960 -48 -0.0
RAM 96940 96900 -40 -0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 705300 705252 -48 -0.0
RAM 97148 97108 -40 -0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 548850 548802 -48 -0.0
RAM 205144 205104 -40 -0.0
lock CC3235SF_LAUNCHXL FLASH 581842 581794 -48 -0.0
RAM 205344 205304 -40 -0.0
efr32 lock-app BRD4187C FLASH 955016 954984 -32 -0.0
RAM 126564 126532 -32 -0.0
BRD4338a FLASH 749468 749380 -88 -0.0
RAM 251912 251880 -32 -0.0
window-app BRD4187C FLASH 1049576 1049512 -64 -0.0
RAM 122760 122728 -32 -0.0
esp32 all-clusters-app c3devkit DRAM 102272 102232 -40 -0.0
FLASH 1780616 1780556 -60 -0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121116 -40 -0.0
FLASH 1747894 1747842 -52 -0.0
IRAM 117071 117071 0 0.0
linux air-purifier-app debug unknown 4856 4856 0 0.0
FLASH 2796646 2796432 -214 -0.0
RAM 117320 117288 -32 -0.0
all-clusters-app debug unknown 5672 5672 0 0.0
FLASH 6198206 6197994 -212 -0.0
RAM 531216 531152 -64 -0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5473562 5473348 -214 -0.0
RAM 228008 227944 -64 -0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4807802 4807588 -214 -0.0
RAM 207712 207648 -64 -0.0
camera-app debug unknown 8976 8976 0 0.0
FLASH 6935131 6934923 -208 -0.0
RAM 230024 229960 -64 -0.0
camera-controller debug unknown 9216 9216 0 0.0
FLASH 14387339 14386923 -416 -0.0
RAM 661528 661528 0 0.0
chip-tool debug unknown 6272 6272 0 0.0
FLASH 14738305 14743555 5250 0.0
RAM 655072 655232 160 0.0
chip-tool-ipv6only arm64 unknown 40672 40672 0 0.0
FLASH 12713487 12718599 5112 0.0
RAM 701344 701480 136 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4790656 4790444 -212 -0.0
RAM 200584 200520 -64 -0.0
fabric-admin debug unknown 5952 5952 0 0.0
FLASH 12798837 12804085 5248 0.0
RAM 654104 654264 160 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4593134 4592920 -214 -0.0
RAM 193424 193360 -64 -0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5741661 5741037 -624 -0.0
RAM 491728 491664 -64 -0.0
lighting-app debug+rpc+ui unknown 6280 6280 0 0.0
FLASH 5694593 5694385 -208 -0.0
RAM 209944 209912 -32 -0.0
lock-app debug unknown 5488 5488 0 0.0
FLASH 4836482 4836270 -212 -0.0
RAM 197192 197128 -64 -0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4446986 4446774 -212 -0.0
RAM 186112 186048 -64 -0.0
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4519108 4518896 -212 -0.0
RAM 188984 188920 -64 -0.0
shell debug unknown 4288 4288 0 0.0
FLASH 3076572 3076348 -224 -0.0
RAM 147344 147280 -64 -0.0
thermostat-no-ble arm64 unknown 9832 9832 0 0.0
FLASH 4236319 4236063 -256 -0.0
RAM 233304 233272 -32 -0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 6106653 6106029 -624 -0.0
RAM 615976 615944 -32 -0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 12888029 12887821 -208 -0.0
RAM 771728 771664 -64 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 888100 888048 -52 -0.0
RAM 166162 166122 -40 -0.0
nrf7002dk_nrf5340_cpuapp FLASH 897252 897204 -48 -0 8000 .0
RAM 145100 145060 -40 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 858424 858372 -52 -0.0
RAM 141049 141014 -35 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1632532 1632452 -80 -0.0
RAM 211104 211064 -40 -0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1576708 1576644 -64 -0.0
RAM 208472 208432 -40 -0.0
light cy8ckit_062s2_43012 FLASH 1449500 1449436 -64 -0.0
RAM 197184 197152 -32 -0.0
lock cy8ckit_062s2_43012 FLASH 1481756 1481692 -64 -0.0
RAM 224904 224872 -32 -0.0
qpg lighting-app qpg6200+debug FLASH 744232 744184 -48 -0.0
RAM 94292 94252 -40 -0.0
lock-app qpg6200+debug FLASH 753852 753804 -48 -0.0
RAM 94320 94280 -40 -0.0
stm32 light STM32WB5MM-DK FLASH 465292 465236 -56 -0.0
RAM 141376 141336 -40 -0.0
telink bridge-app tl7218x FLASH 702340 702268 -72 -0.0
RAM 93600 93564 -36 -0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 794072 794000 -72 -0.0
RAM 44016 43980 -36 -0.1
light-app-ota-shell-factory-data tl7218x FLASH 782478 782406 -72 -0.0
RAM 100912 100876 -36 -0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 709590 709518 -72 -0.0
RAM 54240 54204 -36 -0.1
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 746184 746112 -72 -0.0
RAM 77404 77368 -36 -0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 722910 722838 -72 -0.0
RAM 36996 36960 -36 -0.1
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603014 602942 -72 -0.0
RAM 112532 112496 -36 -0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 818032 817964 -68 -0.0
RAM 99164 99128 -36 -0.0
tizen all-clusters-app arm unknown 5096 5096 0 0.0
FLASH 1695816 1695632 -184 -0.0
RAM 91444 91404 -40 -0.0
chip-tool-ubsan arm unknown 20764 20768 4 0.0
FLASH 21066690 21075954 9264 0.0
RAM 9165440 9169332 3892 0.0

Copy link
github-actions bot commented Jul 11, 2025

PR #39968: Size comparison from 6d5aa8c to 81d3da2

Full report (59 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 6d5aa8c 81d3da2 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1102622 1102622 0 0.0
RAM< 6D40 /td> 179010 178970 -40 -0.0
bl702 lighting-app bl702+eth FLASH 656030 656030 0 0.0
RAM 134961 134929 -32 -0.0
bl702+wifi FLASH 833212 833212 0 0.0
RAM 124517 124469 -48 -0.0
bl706+mfd+rpc+littlefs FLASH 1065330 1065330 0 0.0
RAM 117373 117341 -32 -0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 894876 894876 0 0.0
RAM 105660 105628 -32 -0.0
lighting-app bl702l+mfd+littlefs FLASH 978594 978594 0 0.0
RAM 109852 109820 -32 -0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 763128 763080 -48 -0.0
RAM 103368 103328 -40 -0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 774668 774620 -48 -0.0
RAM 108536 108496 -40 -0.0
pump-app LP_EM_CC1354P10_6 FLASH 721008 720960 -48 -0.0
RAM 96940 96900 -40 -0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 705300 705252 -48 -0.0
RAM 97148 97108 -40 -0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 548850 548802 -48 -0.0
RAM 205144 205104 -40 -0.0
lock CC3235SF_LAUNCHXL FLASH 581842 581794 -48 -0.0
RAM 205344 205304 -40 -0.0
efr32 lock-app BRD4187C FLASH 955016 954984 -32 -0.0
RAM 126564 126532 -32 -0.0
BRD4338a FLASH 749468 749380 -88 -0.0
RAM 251912 251880 -32 -0.0
window-app BRD4187C FLASH 1049576 1049512 -64 -0.0
RAM 122760 122728 -32 -0.0
esp32 all-clusters-app c3devkit DRAM 102272 102232 -40 -0.0
FLASH 1780616 1780556 -60 -0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121116 -40 -0.0
FLASH 1747894 1747842 -52 -0.0
IRAM 117071 117071 0 0.0
linux air-purifier-app debug unknown 4856 4856 0 0.0
FLASH 2796646 2796432 -214 -0.0
RAM 117320 117288 -32 -0.0
all-clusters-app debug unknown 5672 5672 0 0.0
FLASH 6198206 6197994 -212 -0.0
RAM 531216 531152 -64 -0.0
all-clusters-minimal-app debug unknown 5536 5536 0 0.0
FLASH 5473562 5473348 -214 -0.0
RAM 228008 227944 -64 -0.0
bridge-app debug unknown 5568 5568 0 0.0
FLASH 4807802 4807588 -214 -0.0
RAM 207712 207648 -64 -0.0
camera-app debug unknown 8976 8976 0 0.0
FLASH 6935131 6934923 -208 -0.0
RAM 230024 229960 -64 -0.0
camera-controller debug unknown 9216 9216 0 0.0
FLASH 14387339 14386923 -416 -0.0
RAM 661528 661528 0 0.0
chip-tool debug unknown 6272 6272 0 0.0
FLASH 14738305 14743555 5250 0.0
RAM 655072 655232 160 0.0
chip-tool-ipv6only arm64 unknown 40672 40672 0 0.0
FLASH 12713487 12718599 5112 0.0
RAM 701344 701480 136 0.0
closure-app debug unknown 5536 5536 0 0.0
FLASH 4790656 4790444 -212 -0.0
RAM 200584 200520 -64 -0.0
fabric-admin debug unknown 5952 5952 0 0.0
FLASH 12798837 12804085 5248 0.0
RAM 654104 654264 160 0.0
fabric-bridge-app debug unknown 4816 4816 0 0.0
FLASH 4593134 4592920 -214 -0.0
RAM 193424 193360 -64 -0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5741661 5741037 -624 -0.0
RAM 491728 491664 -64 -0.0
lighting-app debug+rpc+ui unknown 6280 6280 0 0.0
FLASH 5694593 5694385 -208 -0.0
RAM 209944 209912 -32 -0.0
lock-app debug unknown 5488 5488 0 0.0
FLASH 4836482 4836270 -212 -0.0
RAM 197192 197128 -64 -0.0
ota-provider-app debug unknown 4856 4856 0 0.0
FLASH 4446986 4446774 -212 -0.0
RAM 186112 186048 -64 -0.0
ota-requestor-app debug unknown 4736 4736 0 0.0
FLASH 4519108 4518896 -212 -0.0
RAM 188984 188920 -64 -0.0
shell debug unknown 4288 4288 0 0.0
FLASH 3076572 3076348 -224 -0.0
RAM 147344 147280 -64 -0.0
thermostat-no-ble arm64 unknown 9832 9832 0 0.0
FLASH 4236319 4236063 -256 -0.0
RAM 233304 233272 -32 -0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 6106653 6106029 -624 -0.0
RAM 615976 615944 -32 -0.0
tv-casting-app debug unknown 5352 5352 0 0.0
FLASH 12888029 12887821 -208 -0.0
RAM 771728 771664 -64 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 888100 888048 -52 -0.0
RAM 166162 166122 -40 -0.0
nrf7002dk_nrf5340_cpuapp FLASH 897252 897204 -48 -0.0
RAM 145100 145060 -40 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 858424 858372 -52 -0.0
RAM 141049 141014 -35 -0.0
nxp contact mcxw71+release FLASH 624800 624744 -56 -0.0
RAM 63164 63132 -32 -0.1
lock mcxw71+release FLASH 776008 775952 -56 -0.0
RAM 67820 67788 -32 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1632532 1632452 -80 -0.0
RAM 211104 211064 -40 -0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1576708 1576644 -64 -0.0
RAM 208472 208432 -40 -0.0
light cy8ckit_062s2_43012 FLASH 1449500 1449436 -64 -0.0
RAM 197184 197152 -32 -0.0
lock cy8ckit_062s2_43012 FLASH 1481756 1481692 -64 -0.0
RAM 224904 224872 -32 -0.0
qpg lighting-app qpg6200+debug FLASH 744232 744184 -48 -0.0
RAM 94292 94252 -40 -0.0
lock-app qpg6200+debug FLASH 753852 753804 -48 -0.0
RAM 94320 94280 -40 -0.0
stm32 light STM32WB5MM-DK FLASH 465292 465236 -56 -0.0
RAM 141376 141336 -40 -0.0
telink bridge-app tl7218x FLASH 702340 702268 -72 -0.0
RAM 93600 93564 -36 -0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 794072 794000 -72 -0.0
RAM 44016 43980 -36 -0.1
light-app-ota-shell-factory-data tl7218x FLASH 782478 782406 -72 -0.0
RAM 100912 100876 -36 -0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 709590 709518 -72 -0.0
RAM 54240 54204 -36 -0.1
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 746184 746112 -72 -0.0
RAM 77404 77368 -36 -0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 722910 722838 -72 -0.0
RAM 36996 36960 -36 -0.1
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603014 602942 -72 -0.0
RAM 112532 112496 -36 -0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 818032 817964 -68 -0.0
RAM 99164 99128 -36 -0.0
tizen all-clusters-app arm unknown 5096 5096 0 0.0
FLASH 1695816 1695632 -184 -0.0
RAM 91444 91404 -40 -0.0
chip-tool-ubsan arm unknown 20764 20768 4 0.0
FLASH 21066690 21075954 9264 0.0
RAM 9165440 9169332 3892 0.0

@mergify mergify bot merged commit 3dd9280 into project-chip:master Jul 12, 2025
80 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0