{"action":"created","issue":{"url":"https://api.github.com/repos/UAVCAN/specification/issues/5","repository_url":"https://api.github.com/repos/UAVCAN/specification","labels_url":"https://api.github.com/repos/UAVCAN/specification/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/UAVCAN/specification/issues/5/comments","events_url":"https://api.github.com/repos/UAVCAN/specification/issues/5/events","html_url":"https://github.com/UAVCAN/specification/issues/5","id":342827385,"node_id":"MDU6SXNzdWUzNDI4MjczODU=","number":5,"title":"Rigorous definition of semantic compatibility and bit compatibility","user":{"login":"pavel-kirienko","id":3298404,"node_id":"MDQ6VXNlcjMyOTg0MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3298404?v=4","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","site_admin":false},"labels":[{"id":979302586,"node_id":"MDU6TGFiZWw5NzkzMDI1ODY=","url":"https://api.github.com/repos/UAVCAN/specification/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-19T17:48:37Z","updated_at":"2018-07-21T13:06:58Z","closed_at":null,"author_association":"MEMBER","body":"So I was writing the new spec doc and got stuck at the semantic and binary compatibility part. I'm leaving the lab right now with the intention of getting back to this first thing in the morning. @kjetilkjeka if you happened to have good definitions at hand, please share here.\r\n\r\nThis is what I ended up drafting so far:\r\n\r\n```latex\r\n\\section{Data type compatibility and versioning}\\label{sec:dsdl_versioning}\r\n\r\n\\subsection{Rationale}\r\n\r\nAs can be seen from the preceding sections,\r\nthe concept of \\emph{data type} is a cornerstone feature of UAVCAN,\r\nwhich sets it apart from many competing solutions.\r\n\r\nIn order to be able to interoperate successfully,\r\nall nodes connected to the same bus must use compatible definitions of all employed data types.\r\nThis section is dedicated to the concepts of \\emph{data type compatibility}\r\nand \\emph{data type versioning}.\r\n\r\nA \\emph{data type} is a named set of data structures defined in DSDL.\r\nAs has been explained above, in the case of message data types,\r\nthe set consists of just one data structure, whereas in the case of service data types\r\nthe set is a pair of request and response data structures.\r\n\r\nData type definitions may evolve over time as they are refined to better address the needs of their applications.\r\nIn order to formalize the data type evolution process with respect to the data type compatibility concerns,\r\nUAVCAN introduces two concepts: \\emph{semantic compatibility} and \\emph{binary compatibility},\r\nwhich are discussed below.\r\n\r\n\\subsection{Semantic compatibility}\r\n\r\n\\subsection{Binary compatibility}\r\n```"},"comment":{"url":"https://api.github.com/repos/UAVCAN/specification/issues/comments/406795606","html_url":"https://github.com/UAVCAN/specification/issues/5#issuecomment-406795606","issue_url":"https://api.github.com/repos/UAVCAN/specification/issues/5","id":406795606,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjc5NTYwNg==","user":{"login":"kjetilkjeka","id":5366742,"node_id":"MDQ6VXNlcjUzNjY3NDI=","avatar_url":"https://avatars3.githubusercontent.com/u/5366742?v=4","gravatar_id":"","url":"https://api.github.com/users/kjetilkjeka","html_url":"https://github.com/kjetilkjeka","followers_url":"https://api.github.com/users/kjetilkjeka/followers","following_url":"https://api.github.com/users/kjetilkjeka/following{/other_user}","gists_url":"https://api.github.com/users/kjetilkjeka/gists{/gist_id}","starred_url":"https://api.github.com/users/kjetilkjeka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjetilkjeka/subscriptions","organizations_url":"https://api.github.com/users/kjetilkjeka/orgs","repos_url":"https://api.github.com/users/kjetilkjeka/repos","events_url":"https://api.github.com/users/kjetilkjeka/events{/privacy}","received_events_url":"https://api.github.com/users/kjetilkjeka/received_events","type":"User","site_admin":false},"created_at":"2018-07-21T13:06:58Z","updated_at":"2018-07-21T13:06:58Z","author_association":"MEMBER","body":"Ok, so binary compatibility is only about serialization. That makes sense. My definition mixed in what applications can expect as well. My proposed constraints will implicitly enforce both the bit compatibility constraints and some other constraints. But it may still be valuable to have a clear split between them.\r\n\r\nYour example is then indeed binary compatible. But if one attempted to update the definition in an application the new code would not compile. And due to that I would say that definition B should not be considered compatible (in the sense of \"total compatibility\") with definition A. I see two simple ways to keep them compatible. \r\n 1. Instead of changing types introduce bitmasks `uint64 STATUS_FLAG_BM = 0xffffffff00000000`\r\n 2. Introduce a concept of untagged unions in dsdl (this might very well be undesired as it makes things a bit more weird and may be difficult to support for some languages).\r\n\r\nI think I described the least strict sensible definition for bit/binary/serialization compatibility in https://github.com/UAVCAN/uavcan.github.io/issues/40 there's no good precise definition there but it can perhaps be used for inspiration? To sum it up, all it cares about are the layout of static fields vs dynamic fields vs union fields."}}
{"actor":{"display_login":"kjetilkjeka"}}