Skip to content
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

Update metadata-tree from MetadaList Foo(path) to CHIP_ERROR Foo(path, ListBuilder &) #37127

Merged
merged 20 commits into from
Jan 23, 2025

Conversation

andy31415
Copy link
Contributor

Made metadata list methods to return CHIP_ERROR and have out arguments. This has the benefit of:

  • CHIP_ERROR is propagated and we make it clear where we do not actually expect errors (via methods named IgnoreError
  • Allows a more natural combining of calls where we can overlay calls, for example if having 2 providers handling an endpoint we can gather all clusters (assuming distinct) via provider1->Clusters(endpointID, list); provider2->Cluster(endpointID, list)

Changes are expected to be roughly flash-size neutral. Some flash increases due to descriptor.cpp now handling errors should be offset by some common code reuse.

Testing

Unit tests updated and added.
This is common code with no functionality difference, so significant coverage exists.

Copy link

Review changes with  SemanticDiff

@andy31415 andy31415 force-pushed the append_only_api branch 6 times, most recently from bd9492b to a39551e Compare January 20, 2025 19:26
Copy link

github-actions bot commented Jan 20, 2025

PR #37127: Size comparison from 2ecbcc2 to c19a4fd

Full report (14 builds for cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
platform target config section 2ecbcc2 c19a4fd change % change
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838032 838032 0 0.0
RAM 123448 123448 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823460 823444 -16 -0.0
RAM 125320 125320 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770652 770628 -24 -0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754904 754888 -16 -0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538457 538461 4 0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572377 572381 4 0.0
RAM 205320 205320 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913692 913680 -12 -0.0
RAM 143148 143148 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888588 888448 -140 -0.0
RAM 141335 141335 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848564 848548 -16 -0.0
RAM 142060 142060 0 0.0
qpg lighting-app qpg6105+debug FLASH 662000 661984 -16 -0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619780 619764 -16 -0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482656 482640 -16 -0.0
RAM 144656 144656 0 0.0
tizen all-clusters-app arm unknown 5112 5116 4 0.1
FLASH 1751208 1751636 428 0.0
RAM 93468 93468 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18205486 18203366 -2120 -0.0
RAM 7951580 7950352 -1228 -0.0

Copy link

github-actions bot commented Jan 20, 2025

PR #37127: Size comparison from 2ecbcc2 to 48dc77c

Full report (14 builds for cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
platform target config section 2ecbcc2 48dc77c change % change
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838032 838024 -8 -0.0
RAM 123448 123448 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823460 823436 -24 -0.0
RAM 125320 125320 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770652 770620 -32 -0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754904 754880 -24 -0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538457 538437 -20 -0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572377 572373 -4 -0.0
RAM 205320 205320 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913692 913652 -40 -0.0
RAM 143148 143148 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888588 888404 -184 -0.0
RAM 141335 141335 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848564 848536 -28 -0.0
RAM 142060 142060 0 0.0
qpg lighting-app qpg6105+debug FLASH 662000 661976 -24 -0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619780 619756 -24 -0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482656 482632 -24 -0.0
RAM 144656 144656 0 0.0
tizen all-clusters-app arm unknown 5112 5116 4 0.1
FLASH 1751208 1751624 416 0.0
RAM 93468 93468 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18205486 18211358 5872 0.0
RAM 7951580 7954068 2488 0.0

andy31415 and others added 2 commits January 20, 2025 15:25
Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
andy31415 and others added 2 commits January 20, 2025 15:27
Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
andy31415 and others added 2 commits January 20, 2025 15:28
Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
Co-authored-by: Tennessee Carmel-Veilleux <tennessee.carmelveilleux@gmail.com>
Copy link

github-actions bot commented Jan 20, 2025

PR #37127: Size comparison from 2ecbcc2 to 6ae480e

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 2ecbcc2 6ae480e change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1092020 1091924 -96 -0.0
RAM 103258 103258 0 0.0
bl702 lighting-app bl702+eth FLASH 650242 650146 -96 -0.0
RAM 25265 25265 0 0.0
bl702+wifi FLASH 828110 827758 -352 -0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1055140 1055040 -100 -0.0
RAM 23845 23845 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888138 888038 -100 -0.0
RAM 18504 18504 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971124 971024 -100 -0.0
RAM 16368 16368 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838032 838024 -8 -0.0
RAM 123448 123448 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823460 823436 -24 -0.0
RAM 125320 125320 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770652 770620 -32 -0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754904 754880 -24 -0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538457 538437 -20 -0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572377 572373 -4 -0.0
RAM 205320 205320 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679473 679457 -16 -0.0
RAM 78508 78508 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699325 699309 -16 -0.0
RAM 81148 81148 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699325 699309 -16 -0.0
RAM 81148 81148 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656253 656237 -16 -0.0
RAM 73576 73576 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615833 615809 -24 -0.0
RAM 71492 71492 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635461 635437 -24 -0.0
RAM 74036 74036 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635461 635437 -24 -0.0
RAM 74036 74036 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635337 635313 -24 -0.0
RAM 74500 74500 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 655045 655021 -24 -0.0
RAM 77044 77044 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 655045 655021 -24 -0.0
RAM 77044 77044 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611797 611765 -32 -0.0
RAM 68588 68588 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631657 631625 -32 -0.0
RAM 71228 71228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631657 631625 -32 -0.0
RAM 71228 71228 0 0.0
efr32 lock-app BRD4187C FLASH 934704 934672 -32 -0.0
RAM 159904 159904 0 0.0
BRD4338a FLASH 729660 729412 -248 -0.0
RAM 234748 234748 0 0.0
window-app BRD4187C FLASH 1029320 1029088 -232 -0.0
RAM 128008 128008 0 0.0
esp32 all-clusters-app c3devkit DRAM 95088 95088 0 0.0
FLASH 1536902 1536686 -216 -0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116076 116076 0 0.0
FLASH 1544990 1544994 4 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4760 8 0.2
FLASH 2708893 2708469 -424 -0.0
RAM 132800 132800 0 0.0
all-clusters-app debug unknown 5560 5568 8 0.1
FLASH 5974758 5974290 -468 -0.0
RAM 531520 531520 0 0.0
all-clusters-minimal-app debug unknown 5456 5464 8 0.1
FLASH 5322532 5322076 -456 -0.0
RAM 242632 242632 0 0.0
bridge-app debug unknown 5472 5480 8 0.1
FLASH 4680676 4680264 -412 -0.0
RAM 221368 221368 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 13044040 13044636 596 0.0
RAM 596178 596178 0 0.0
chip-tool-ipv6only arm64 unknown 21776 21776 0 0.0
FLASH 11121376 11121984 608 0.0
RAM 647920 647920 0 0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11391015 11391611 596 0.0
RAM 596522 596522 0 0.0
fabric-bridge-app debug unknown 4728 4736 8 0.2
FLASH 4506102 4505690 -412 -0.0
RAM 208552 208552 0 0.0
fabric-sync debug unknown 4968 4976 8 0.2
FLASH 5608677 5610789 2112 0.0
RAM 483328 483424 96 0.0
lighting-app debug+rpc+ui unknown 6136 6144 8 0.1
FLASH 5615681 5615233 -448 -0.0
RAM 231648 231648 0 0.0
lock-app debug unknown 5408 5416 8 0.1
FLASH 4730622 4730210 -412 -0.0
RAM 207616 207616 0 0.0
ota-provider-app debug unknown 4768 4776 8 0.2
FLASH 4359434 4358990 -444 -0.0
RAM 201352 201352 0 0.0
ota-requestor-app debug unknown 4720 4728 8 0.2
FLASH 4496938 4496494 -444 -0.0
RAM 205936 205936 0 0.0
shell debug unknown 4248 4256 8 0.2
FLASH 3004845 3004381 -464 -0.0
RAM 160408 160408 0 0.0
thermostat-no-ble arm64 unknown 9536 9536 0 0.0
FLASH 4098736 4098304 -432 -0.0
RAM 246064 246064 0 0.0
tv-app debug unknown 5736 5744 8 0.1
FLASH 5948581 5950725 2144 0.0
RAM 606760 606824 64 0.0
tv-casting-app debug unknown 5312 5320 8 0.2
FLASH 11271245 11270909 -336 -0.0
RAM 710736 710736 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913692 913652 -40 -0.0
RAM 143148 143148 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888588 888404 -184 -0.0
RAM 141335 141335 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848564 848536 -28 -0.0
RAM 142060 142060 0 0.0
nxp contact k32w0+release FLASH 584304 584272 -32 -0.0
RAM 70860 70860 0 0.0
mcxw71+release FLASH 599656 599616 -40 -0.0
RAM 63080 63080 0 0.0
light k32w0+release FLASH 610732 610700 -32 -0.0
RAM 70252 70252 0 0.0
k32w1+release FLASH 685208 685168 -40 -0.0
RAM 48664 48664 0 0.0
lock mcxw71+release FLASH 761288 761240 -48 -0.0
RAM 70708 70708 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646292 1646196 -96 -0.0
RAM 211544 211544 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1552876 1552748 -128 -0.0
RAM 208352 208352 0 0.0
light cy8ckit_062s2_43012 FLASH 1468764 1468652 -112 -0.0
RAM 200328 200328 0 0.0
lock cy8ckit_062s2_43012 FLASH 1466796 1466684 -112 -0.0
RAM 224672 224672 0 0.0
qpg lighting-app qpg6105+debug FLASH 662000 661976 -24 -0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619780 619756 -24 -0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482656 482632 -24 -0.0
RAM 144656 144656 0 0.0
telink bridge-app tlsr9258a FLASH 681398 681224 -174 -0.0
RAM 91064 91064 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 621610 621432 -178 -0.0
RAM 31464 31464 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 770456 770262 -194 -0.0
RAM 49324 49324 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 774874 774700 -174 -0.0
RAM 99628 99628 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 708784 708610 -174 -0.0
RAM 73356 73356 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625884 625710 -174 -0.0
RAM 141996 141996 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811934 811750 -184 -0.0
RAM 99540 99540 0 0.0
tizen all-clusters-app arm unknown 5112 5116 4 0.1
FLASH 1751208 1751624 416 0.0
RAM 93468 93468 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18205486 18211358 5872 0.0
RAM 7951580 7954068 2488 0.0

Copy link

github-actions bot commented Jan 20, 2025

PR #37127: Size comparison from b5cdd21 to eaf9f0c

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section b5cdd21 eaf9f0c change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1092018 1091924 -94 -0.0
RAM 103258 103258 0 0.0
bl702 lighting-app bl702+eth FLASH 650236 650142 -94 -0.0
RAM 25265 25265 0 0.0
bl702+wifi FLASH 828106 827756 -350 -0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1055136 1055038 -98 -0.0
RAM 23845 23845 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888134 888036 -98 -0.0
RAM 18504 18504 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971120 971022 -98 -0.0
RAM 16368 16368 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838024 838016 -8 -0.0
RAM 123448 123448 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823452 823436 -16 -0.0
RAM 125320 125320 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770636 770612 -24 -0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754888 754872 -16 -0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538433 538437 4 0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572369 572373 4 0.0
RAM 205320 205320 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679473 679465 -8 -0.0
RAM 78508 78508 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699317 699309 -8 -0.0
RAM 81148 81148 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699317 699309 -8 -0.0
RAM 81148 81148 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656253 656245 -8 -0.0
RAM 73576 73576 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615833 615817 -16 -0.0
RAM 71492 71492 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635461 635445 -16 -0.0
RAM 74036 74036 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635461 635445 -16 -0.0
RAM 74036 74036 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635329 635313 -16 -0.0
RAM 74500 74500 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 655045 655029 -16 -0.0
RAM 77044 77044 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 655045 655029 -16 -0.0
RAM 77044 77044 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611773 611765 -8 -0.0
RAM 68588 68588 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631633 631625 -8 -0.0
RAM 71228 71228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631633 631625 -8 -0.0
RAM 71228 71228 0 0.0
efr32 lock-app BRD4187C FLASH 934704 934672 -32 -0.0
RAM 159904 159904 0 0.0
BRD4338a FLASH 729580 729396 -184 -0.0
RAM 234748 234748 0 0.0
window-app BRD4187C FLASH 1029288 1029088 -200 -0.0
RAM 128008 128008 0 0.0
esp32 all-clusters-app c3devkit DRAM 95088 95088 0 0.0
FLASH 1536886 1536686 -200 -0.0
IRAM 82552 82552 0 0.0
m5stack DRAM 116076 116076 0 0.0
FLASH 1544970 1544998 28 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4760 8 0.2
FLASH 2708845 2708469 -376 -0.0
RAM 132800 132800 0 0.0
all-clusters-app debug unknown 5560 5568 8 0.1
FLASH 5974698 5974290 -408 -0.0
RAM 531520 531520 0 0.0
all-clusters-minimal-app debug unknown 5456 5464 8 0.1
FLASH 5322484 5322076 -408 -0.0
RAM 242632 242632 0 0.0
bridge-app debug unknown 5472 5480 8 0.1
FLASH 4680640 4680264 -376 -0.0
RAM 221368 221368 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 13046528 13044668 -1860 -0.0
RAM 596178 596178 0 0.0
chip-tool-ipv6only arm64 unknown 21776 21776 0 0.0
FLASH 1112372 11121984 -1744 -0.0
RAM 647920 647920 0 0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11393503 11391643 -1860 -0.0
RAM 596522 596522 0 0.0
fabric-bridge-app debug unknown 4728 4736 8 0.2
FLASH 4506068 4505692 -376 -0.0
RAM 208552 208552 0 0.0
fabric-sync debug unknown 4968 4976 8 0.2
FLASH 5611141 5610757 -384 -0.0
RAM 483424 483424 0 0.0
lighting-app debug+rpc+ui unknown 6136 6144 8 0.1
FLASH 5615681 5615265 -416 -0.0
RAM 231648 231648 0 0.0
lock-app debug unknown 5408 5416 8 0.1
FLASH 4730586 4730210 -376 -0.0
RAM 207616 207616 0 0.0
ota-provider-app debug unknown 4768 4776 8 0.2
FLASH 4359432 4359024 -408 -0.0
RAM 201352 201352 0 0.0
ota-requestor-app debug unknown 4720 4728 8 0.2
FLASH 4496936 4496528 -408 -0.0
RAM 205936 205936 0 0.0
shell debug unknown 4248 4256 8 0.2
FLASH 3004781 3004381 -400 -0.0
RAM 160408 160408 0 0.0
thermostat-no-ble arm64 unknown 9536 9536 0 0.0
FLASH 4098720 4098304 -416 -0.0
RAM 246064 246064 0 0.0
tv-app debug unknown 5736 5744 8 0.1
FLASH 5951077 5950725 -352 -0.0
RAM 606824 606824 0 0.0
tv-casting-app debug unknown 5312 5320 8 0.2
FLASH 11271213 11270909 -304 -0.0
RAM 710736 710736 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913664 913652 -12 -0.0
RAM 143148 143148 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888544 888404 -140 -0.0
RAM 141335 141335 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848552 848536 -16 -0.0
RAM 142060 142060 0 0.0
nxp contact k32w0+release FLASH 584288 584272 -16 -0.0
RAM 70860 70860 0 0.0
mcxw71+release FLASH 599632 599616 -16 -0.0
RAM 63080 63080 0 0.0
light k32w0+release FLASH 610716 610700 -16 -0.0
RAM 70252 70252 0 0.0
k32w1+release FLASH 685184 685168 -16 -0.0
RAM 48664 48664 0 0.0
lock mcxw71+release FLASH 761264 761248 -16 -0.0
RAM 70708 70708 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646340 1646196 -144 -0.0
RAM 211544 211544 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1552892 1552748 -144 -0.0
RAM 208352 208352 0 0.0
light cy8ckit_062s2_43012 FLASH 1468780 1468652 -128 -0.0
RAM 200328 200328 0 0.0
lock cy8ckit_062s2_43012 FLASH 1466828 1466684 -144 -0.0
RAM 224672 224672 0 0.0
qpg lighting-app qpg6105+debug FLASH 661992 661976 -16 -0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619772 619756 -16 -0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482648 482632 -16 -0.0
RAM 144656 144656 0 0.0
telink bridge-app tlsr9258a FLASH 681396 681224 -172 -0.0
RAM 91064 91064 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 621608 621432 -176 -0.0
RAM 31464 31464 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 770454 770262 -192 -0.0
RAM 49324 49324 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 774872 774700 -172 -0.0
RAM 99628 99628 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 708782 708610 -172 -0.0
RAM 73356 73356 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625882 625710 -172 -0.0
RAM 141996 141996 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811932 811750 -182 -0.0
RAM 99540 99540 0 0.0
tizen all-clusters-app arm unknown 5112 5116 4 0.1
FLASH 1751184 1751612 428 0.0
RAM 93468 93468 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18213494 18211374 -2120 -0.0
RAM 7955128 7953956 -1172 -0.0

andy31415 and others added 2 commits January 23, 2025 13:24
Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com>
Copy link

github-actions bot commented Jan 23, 2025

PR #37127: Size comparison from 575a440 to ded4d53

Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 575a440 ded4d53 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1093880 1093530 -350 -0.0
RAM 103298 103298 0 0.0
bl702 lighting-app bl702+eth FLASH 650236 650142 -94 -0.0
RAM 25265 25265 0 0.0
bl702+wifi FLASH 828400 828050 -350 -0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1056700 1056602 -98 -0.0
RAM 23861 23861 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888134 888036 -98 -0.0
RAM 18504 18504 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971120 971022 -98 -0.0
RAM 16368 16368 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838000 837992 -8 -0.0
RAM 123464 123464 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823412 823396 -16 -0.0
RAM 125344 125344 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 770636 770612 -24 -0.0
RAM 113804 113804 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 754888 754872 -16 -0.0
RAM 114012 114012 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538433 538437 4 0.0
RAM 205192 205192 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572297 572301 4 0.0
RAM 205344 205344 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679401 679393 -8 -0.0
RAM 78532 78532 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699253 699245 -8 -0.0
RAM 81172 81172 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699253 699245 -8 -0.0
RAM 81172 81172 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656181 656173 -8 -0.0
RAM 73600 73600 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 615793 615777 -16 -0.0
RAM 71516 71516 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635421 635405 -16 -0.0
RAM 74060 74060 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635421 635405 -16 -0.0
RAM 74060 74060 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635265 635249 -16 -0.0
RAM 74524 74524 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 654973 654957 -16 -0.0
RAM 77068 77068 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 654973 654957 -16 -0.0
RAM 77068 77068 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 611701 611693 -8 -0.0
RAM 68612 68612 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631561 631553 -8 -0.0
RAM 71252 71252 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631561 631553 -8 -0.0
RAM 71252 71252 0 0.0
efr32 lock-app BRD4187C FLASH 936264 936232 -32 -0.0
RAM 159904 159904 0 0.0
BRD4338a FLASH 729676 729476 -200 -0.0
RAM 234768 234768 0 0.0
window-app BRD4187C FLASH 1029352 1029152 -200 -0.0
RAM 128040 128040 0 0.0
esp32 all-clusters-app c3devkit DRAM 97296 97296 0 0.0
FLASH 1577224 1577024 -200 -0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 116092 116092 0 0.0
FLASH 1544946 1544974 28 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4752 4760 8 0.2
FLASH 2708845 2708469 -376 -0.0
RAM 132800 132800 0 0.0
all-clusters-app debug unknown 5560 5568 8 0.1
FLASH 5974932 5974524 -408 -0.0
RAM 531616 531616 0 0.0
all-clusters-minimal-app debug unknown 5456 5464 8 0.1
FLASH 5323618 5323210 -408 -0.0
RAM 242728 242728 0 0.0
bridge-app debug unknown 5472 5480 8 0.1
FLASH 4681806 4681398 -408 -0.0
RAM 221464 221464 0 0.0
chip-tool debug unknown 5984 5984 0 0.0
FLASH 13044084 13042256 -1828 -0.0
RAM 596178 596178 0 0.0
chip-tool-ipv6only arm64 unknown 21776 21776 0 0.0
FLASH 11120688 11118960 -1728 -0.0
RAM 647920 647920 0 0.0
fabric-admin debug unknown 5808 5808 0 0.0
FLASH 11390197 11388337 -1860 -0.0
RAM 596522 596522 0 0.0
fabric-bridge-app debug unknown 4728 4736 8 0.2
FLASH 4506340 4505996 -344 -0.0
RAM 208648 208648 0 0.0
fabric-sync debug unknown 4968 4976 8 0.2
FLASH 5612613 5612245 -368 -0.0
RAM 483520 483520 0 0.0
lighting-app debug+rpc+ui unknown 6136 6144 8 0.1
FLASH 5624561 5624177 -384 -0.0
RAM 231744 231744 0 0.0
lock-app debug unknown 5408 5416 8 0.1
FLASH 4730856 4730448 -408 -0.0
RAM 207712 207712 0 0.0
ota-provider-app debug unknown 4768 4776 8 0.2
FLASH 4359432 4359024 -408 -0.0
RAM 201352 201352 0 0.0
ota-requestor-app debug unknown 4720 4728 8 0.2
FLASH 4496936 4496528 -408 -0.0
RAM 205936 205936 0 0.0
shell debug unknown 4248 4256 8 0.2
FLASH 3005021 3004605 -416 -0.0
RAM 160504 160504 0 0.0
thermostat-no-ble arm64 unknown 9536 9536 0 0.0
FLASH 4098896 4098480 -416 -0.0
RAM 246136 246136 0 0.0
tv-app debug unknown 5736 5744 8 0.1
FLASH 5952245 5951861 -384 -0.0
RAM 606920 606920 0 0.0
tv-casting-app debug unknown 5312 5320 8 0.2
FLASH 11269565 11269245 -320 -0.0
RAM 710864 710864 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 913652 913640 -12 -0.0
RAM 143168 143168 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 888632 888496 -136 -0.0
RAM 141355 141355 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 848696 848680 -16 -0.0
RAM 142080 142080 0 0.0
nxp contact k32w0+release FLASH 584288 584272 -16 -0.0
RAM 70860 70860 0 0.0
mcxw71+release FLASH 599632 599616 -16 -0.0
RAM 63080 63080 0 0.0
light k32w0+release FLASH 610716 610700 -16 -0.0
RAM 70252 70252 0 0.0
k32w1+release FLASH 685184 685168 -16 -0.0
RAM 48664 48664 0 0.0
lock mcxw71+release FLASH 748648 748632 -16 -0.0
RAM 67476 67476 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646420 1646292 -128 -0.0
RAM 211560 211560 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553212 1553068 -144 -0.0
RAM 208376 208376 0 0.0
light cy8ckit_062s2_43012 FLASH 1468876 1468748 -128 -0.0
RAM 200352 200352 0 0.0
lock cy8ckit_062s2_43012 FLASH 1466908 1466780 -128 -0.0
RAM 224688 224688 0 0.0
qpg lighting-app qpg6105+debug FLASH 661992 661976 -16 -0.0
RAM 105204 105204 0 0.0
lock-app qpg6105+debug FLASH 619772 619756 -16 -0.0
RAM 99648 99648 0 0.0
stm32 light STM32WB5MM-DK FLASH 482608 482592 -16 -0.0
RAM 144672 144672 0 0.0
telink bridge-app tlsr9258a FLASH 681522 681350 -172 -0.0
RAM 91084 91084 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 621556 621380 -176 -0.0
RAM 31484 31484 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 770426 770234 -192 -0.0
RAM 49344 49344 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 774822 774650 -172 -0.0
RAM 99648 99648 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 708724 708552 -172 -0.0
RAM 73376 73376 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625832 625660 -172 -0.0
RAM 142016 142016 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 813224 813032 -192 -0.0
RAM 99560 99560 0 0.0
tizen all-clusters-app arm unknown 5112 5116 4 0.1
FLASH 1751312 1751752 440 0.0
RAM 93524 93524 0 0.0
chip-tool-ubsan arm unknown 11024 11024 0 0.0
FLASH 18214030 18211902 -2128 -0.0
RAM 7955248 7954076 -1172 -0.0

@mergify mergify bot merged commit 43f37d1 into project-chip:master Jan 23, 2025
69 checks passed
if (mBuffer == nullptr)
{
mBuffer = static_cast<uint8_t *>(Platform::MemoryCalloc(numElements, mElementSize));
mCapacity = numElements;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really want to set a nonzero mCapacity if allocation failed?

mBuffer = const_cast<uint8_t *>(static_cast<const uint8_t *>(buffer));
mElementCount = numElements;
// The assertions below are because we know the buffer is null/not allocated yet
VerifyOrDie(mCapacity == 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, except above we set mCapacity to be nonzero on allocation failure, right? And we set mBufferIsAllocated to true too...

Copy link
Contributor Author

@andy31415 andy31415 Jan 31, 2025

Choose a reason for hiding this comment

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

That was an oversight. Moved the return on alloc failure.

/// Ensure that at least the specified number of elements
/// can be appended to the internal buffer;
///
/// This will cause the internal buffer to become and allocated buffer
Copy link
Contributor

Choose a reason for hiding this comment

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

"an", not "and"

if ((mBuffer != nullptr) && mAllocated)
ReturnErrorOnFailure(EnsureAppendCapacity(numElements));

memcpy(mBuffer + mElementCount * mElementSize, buffer, numElements * mElementSize);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be memmove, because nothing guarantees that buffer does not point somewhere inside mBuffer here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be bad, because EnsureAppendCapacity may reallocate/move data, so if the buffer we receive points inside itself, it would not be moved.

In theory possible (e.g. by calling EnsureAppendCapacity first) however it seems like a pattern we should not support. I would rather place this in documentation/requirements because of that. It is a footgun to try to append from itself. Also some logical error because we mostly want unique things in our array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probaly in the current design not even possible because the builders do not provide external access to the buffer. Adding docs and __restrict__

Copy link
Contributor

Choose a reason for hiding this comment

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

OK.

void SetImmutable() const { mIsImmutable = true; }
/// Represents a RAII instance owning a buffer.
///
/// It auto-frees the owned buffer on destruction
Copy link
Contributor

Choose a reason for hiding this comment

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

Using what deallocator? Should be documented.

@@ -186,6 +186,12 @@ class ProviderMetadataTree
/// TODO: We should remove this function when the AttributeAccessInterface/CommandHandlerInterface is able to report
/// the attribute changes.
virtual void Temporary_ReportAttributeChanged(const AttributePathParams & path) = 0;

// "convenience" functions that just return the data and ignore the error
// This returns the builder as-is even after the error (e.g. not found would return empty data)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not in fact returning the builder.

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