Skip to content

WIP on agent-generated ctime specs#46

Draft
pgiarrusso-sl wants to merge 17 commits intomainfrom
paolo/agent-ctime
Draft

WIP on agent-generated ctime specs#46
pgiarrusso-sl wants to merge 17 commits intomainfrom
paolo/agent-ctime

Conversation

@pgiarrusso-sl
Copy link
Copy Markdown
Contributor

@pgiarrusso-sl pgiarrusso-sl commented Apr 9, 2026

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 9, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime a696737 main cd4b46f #46

Passive Repos

Repo Job Branch Job Commit
./ main 64a8e0d
fmdeps/BRiCk/ main 9ebe298
fmdeps/auto/ main e77b825
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main 6c1999f
fmdeps/ci/ main 41c7609
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main 451fcaa
psi/ide/ main 6b596cf
psi/data/ main f283f23
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 61c9d23
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7c3aae7
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
+0.00% 123482.6 123482.6 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100845.8 100845.8 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
+0.00% 123482.6 123482.6 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100845.8 100845.8 +0.0 └ proofs and tests

Copy link
Copy Markdown
Collaborator

@gmalecha-at-skylabs gmalecha-at-skylabs left a comment

Choose a reason for hiding this comment

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

Looks nice!

@@ -0,0 +1,44 @@
(*
* Copyright (c) 2025 SkyLabs AI, Inc.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2025 SkyLabs AI, Inc.
* Copyright (c) 2026 SkyLabs AI, Inc.

@@ -0,0 +1,49 @@
(*
* Copyright (c) 2025 SkyLabs AI, Inc.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2025 SkyLabs AI, Inc.
* Copyright (c) 2026 SkyLabs AI, Inc.

Definition clock_t_model := Z.
Definition time_t_model := Z.

Parameter clock_result : clock_t_model -> Prop.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe prefer naming this clock_t_wf or something like that?

\post{t}[Vint t]
[| current_time_result t |] **
if bool_decide (timer_p = nullptr) then emp
else timer_p |-> primR Tlong 1$m (Vint t)).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to have a notation for time_tR?

Comment thread rocq-brick-libstdcpp/proof/ctime/pred.v Outdated
Comment on lines +35 to +37
Parameter tmR_hidden :
cQp.t -> tm_model -> Z -> cstring.t -> Rep.
#[only(type_ptr="tm", cfracsplittable)] derive tmR_hidden.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Most of these are "obvious", but I don't really understand this one. It doesn't seem like the Z and cstring.t are relevant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

grep finds the answer in design.md:

  1. tmR hides non-standard tm_gmtoff and tm_zone fields behind tmR_hidden, while timespecR tracks only tv_sec and tv_nsec.

See the source code:

/* ISO C `broken-down time' structure.  */
struct tm
{
  int tm_sec;			/* Seconds.	[0-60] (1 leap second) */
  int tm_min;			/* Minutes.	[0-59] */
  int tm_hour;			/* Hours.	[0-23] */
  int tm_mday;			/* Day.		[1-31] */
  int tm_mon;			/* Month.	[0-11] */
  int tm_year;			/* Year	- 1900.  */
  int tm_wday;			/* Day of week.	[0-6] */
  int tm_yday;			/* Days in year.[0-365]	*/
  int tm_isdst;			/* DST.		[-1/0/1]*/

# ifdef	__USE_MISC
  long int tm_gmtoff;		/* Seconds east of UTC.  */
  const char *tm_zone;		/* Timezone abbreviation.  */
# else
  long int __tm_gmtoff;		/* Seconds east of UTC.  */
  const char *__tm_zone;	/* Timezone abbreviation.  */
# endif
};

However, this is "malicious genie" compliance: the agent executed the plan, and since the plan forgets other fields, so did the agent.

  Definition tmR (q : cQp.t) (tm : tm_model) : Rep :=
    Exists gmtoff zone,
      tmR_hidden q tm gmtoff zone.

But the fix was easy

Please review again tmR, against both the plan and its job.

The agent even realized that, since tmR_hidden exposes a cstring.t model, it must owns the actual string, which is questionable. The agent correctly suggested exposing a ptr. I suggested exposing nothing to defer the whole question — it turns out this field points to static storage so the discipline requires more care.

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 9, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime feb8836 main cd4b46f #46

Passive Repos

Repo Job Branch Job Commit
./ main 64a8e0d
fmdeps/BRiCk/ main 9ebe298
fmdeps/auto/ main e77b825
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main 6c1999f
fmdeps/ci/ main 41c7609
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main 451fcaa
psi/ide/ main 6b596cf
psi/data/ main f283f23
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 61c9d23
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7c3aae7
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
+0.00% 123482.6 123482.6 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100845.8 100845.8 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
+0.00% 123482.6 123482.6 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100845.8 100845.8 +0.0 └ proofs and tests

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 9, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime 7f50507 main e96a0fc #46

Passive Repos

Repo Job Branch Job Commit
./ main 64a8e0d
fmdeps/BRiCk/ main 594f065
fmdeps/auto/ main e77b825
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main 6c1999f
fmdeps/ci/ main 41c7609
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main 451fcaa
psi/ide/ main 6b596cf
psi/data/ main f283f23
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 61c9d23
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7c3aae7
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
+0.00% 123490.4 123490.4 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100853.6 100853.6 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
+0.00% 123490.4 123490.4 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100853.6 100853.6 +0.0 └ proofs and tests

Comment thread rocq-brick-libstdcpp/proof/ctime/spec.v Outdated
Comment on lines +47 to +51
\prepost{q tm_in} tm_p |-> tmR q tm_in
\post{t}[Vint t]
Exists tm_out,
[| mktime_result tm_in tm_out t |] **
tm_p |-> tmR q tm_out).
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Buggy! I only noticed because tmR_learnable broke some client proof.

if bool_decide (res = nullptr) then emp
else Exists out,
[| asctime_text_of tm out |] **
[| cstring.size out = 25 |] **
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👀

[| utc_time_to_tm t tm |] **
res |-> tmR (cQp.const qret) tm **
□ (Forall (qret' : Qp),
res |-> tmR (cQp.const qret') tm ={⊤}=∗ emp)).
Copy link
Copy Markdown
Contributor Author

@pgiarrusso-sl pgiarrusso-sl Apr 9, 2026

Choose a reason for hiding this comment

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

String-like borrowing 👀

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 9, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime 1430d35 main e96a0fc #46

Passive Repos

Repo Job Branch Job Commit
./ main 64a8e0d
fmdeps/BRiCk/ main 594f065
fmdeps/auto/ main e77b825
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main 6c1999f
fmdeps/ci/ main 41c7609
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main 451fcaa
psi/ide/ main 6b596cf
psi/data/ main f283f23
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 61c9d23
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7c3aae7
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
+0.00% 123490.4 123490.4 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100853.6 100853.6 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
+0.00% 123490.4 123490.4 +0.0 total
+0.00% 22636.8 22636.8 +0.0 ├ translation units
+0.00% 100853.6 100853.6 +0.0 └ proofs and tests

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 10, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime 29dfeb8 main e96a0fc #46

Passive Repos

Repo Job Branch Job Commit
./ main 64a8e0d
fmdeps/BRiCk/ main 594f065
fmdeps/auto/ main e77b825
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main 6c1999f
fmdeps/ci/ main 41c7609
vendored/elpi/ skylabs-master aa4475f
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main 451fcaa
psi/ide/ main 6b596cf
psi/data/ main f283f23
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 61c9d23
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7c3aae7
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
-0.00% 123490.4 123490.4 -0.0 total
-0.00% 22636.8 22636.8 -0.0 ├ translation units
+0.00% 100853.6 100853.6 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
-0.00% 123490.4 123490.4 -0.0 total
-0.00% 22636.8 22636.8 -0.0 ├ translation units
+0.00% 100853.6 100853.6 +0.0 └ proofs and tests

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 15, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime e2347ff main e96a0fc #46

Passive Repos

Repo Job Branch Job Commit
./ main 6d9572d
fmdeps/BRiCk/ main ceb6c7b
fmdeps/auto/ main d39dc2d
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main e1da62f
fmdeps/ci/ main f2d3e2d
vendored/elpi/ skylabs-master aa4475f
vendored/flocq/ skylabs-master cf9cc84
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main 451fcaa
psi/ide/ main 6b596cf
psi/data/ main f283f23
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 61c9d23
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 7c3aae7
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
-0.00% 123301.6 123301.6 -0.0 total
-0.00% 22636.8 22636.8 -0.0 ├ translation units
+0.00% 100664.8 100664.8 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
-0.00% 123301.6 123301.6 -0.0 total
-0.00% 22636.8 22636.8 -0.0 ├ translation units
+0.00% 100664.8 100664.8 +0.0 └ proofs and tests

@skylabs-ai-ci
Copy link
Copy Markdown

skylabs-ai-ci Bot commented Apr 23, 2026

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Base branch Base commit PR
fmdeps/brick-libcpp/ paolo/agent-ctime 60690bc main e96a0fc #46

Passive Repos

Repo Job Branch Job Commit
./ main e8e81bb
fmdeps/BRiCk/ main e219b6b
fmdeps/auto/ main 26885ed
fmdeps/auto-docs/ main 9f57097
bluerock/NOVA/ skylabs-proof e9a69cc
bluerock/bhv/ skylabs-main e1da62f
fmdeps/ci/ main 749706e
vendored/elpi/ skylabs-master aa4475f
vendored/flocq/ skylabs-master cf9cc84
fmdeps/fm-ci/ main 262fb04
fmdeps/fm-tools/ main e17f6db
psi/protos/ main 8fe3e7c
psi/backend/ main a5fa400
psi/ide/ main 6b596cf
psi/data/ main 76acc2f
vendored/rocq/ skylabs-master 2ede3c9
fmdeps/rocq-agent-toolkit/ main 3bed8c2
vendored/rocq-elpi/ skylabs-master 103a742
vendored/rocq-equations/ skylabs-main a8c4832
vendored/rocq-ext-lib/ skylabs-master 94a6630
vendored/rocq-iris/ skylabs-master 3ad4ddd
vendored/rocq-lsp/ skylabs-main a8b7272
vendored/rocq-stdlib/ skylabs-master bc07423
vendored/rocq-stdpp/ skylabs-master e01d802
fmdeps/skylabs-fm/ main 62d34c3
vendored/vsrocq/ skylabs-main 5b4527e

Performance

Relative Master MR Change Filename
-0.00% 123356.6 123356.6 -0.0 total
-0.00% 22637.5 22637.5 -0.0 ├ translation units
+0.00% 100719.1 100719.1 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
-0.00% 123356.6 123356.6 -0.0 total
-0.00% 22637.5 22637.5 -0.0 ├ translation units
+0.00% 100719.1 100719.1 +0.0 └ proofs and tests

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